Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Login ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Well user_name is what I used in the login dialog and also what I used in my login table, I also get an error if I use username, so I am not sure where I am going wrong.

    Dale

    Comment


      #17
      Sure, the answer is right there in your last post. Your error is in the Validate code when you have the scope as session. That is because you still have "user_name" in your Validate event code, rather than session.user_name. Its a bit confusing because you have your username field and control both named "user_name". (And the table as user_names, also a close match).

      Here's the bottom line, if your control's scope is session, you have to make sure you always refer to it as session.xxx. If it is local, you always refer to it naked, just xxx. I normally name my dialog controls like dlg_xxx (e.g.: dlg_user_name) so I don't confuse them.

      Your variable is not named username.
      Steve Wood
      See my profile on IADN

      Comment


        #18
        So would my Validate statement look like this

        (You will have to forgive me I know next to nothing about code which is probably why I am having such a hard time of this, but I really appreciate the help)

        if session.user_name = "" .or. password = "" then
        currentform.has_error = .t.
        currentform.error_message = "Invalid user name or password."
        else
        dim correct_password as c
        DIM level AS N

        correct_password = lookup("[PathAlias.ADB_Path]\user_names","session.user_name=" + quote(session.user_name),"password")
        if correct_password = password then
        level = lookup("[PathAlias.ADB_Path]\user_names","session.user_name=" + quote(session.user_name),"level")
        session.__protected__SecurityLevel = level
        session.__protected__UserName = session.user_name
        ELSE
        currentform.has_error = .t.
        currentform.error_message = "Invalid user name or password."
        end if
        end if

        Dale

        Comment


          #19
          Looks good on paper. Technically, you'd pull out the following and put it in the AfterValidate because you only want to assign variables IF the user's login validates. But it will still work where you have it.

          Code:
          level = lookup("[PathAlias.ADB_Path]\user_names","session.user_name=" + quote(session.user_name),"level")
          session.__protected__SecurityLevel = level
          session.__protected__UserName = session.user_name
          Be sure, after you get all this login stuff, that you understand the role of logintest.a5w and how to protect your pages from unauthorized access.
          Steve Wood
          See my profile on IADN

          Comment


            #20
            OK I am back ( been busier than a one legged man at a butt kicking contest).

            I have tried what you suggested Steve and it is partially working.

            It will create a log for me, however it gives me an error on the log in page;

            The error is:

            Errors in: event.Form Level Validate code: Variable "user_name" not found.

            It gives me this and will not let me into my pages, they are all secured so you have to be logged in to see them, Rich showed me how to do that, so I am good there. Like I said above it will produce a audit record and show when I tried to log in.

            THis is what my code looks like for my Validate: (maybe something will jump out at you I have been banging my head against the wall trying to figure it out, and since i dont know what I am doing all i have gotten is a headache HAHA)

            Validate code:

            if session.user_name = "" .or. password = "" then
            currentform.has_error = .t.
            currentform.error_message = "Invalid user name or password."
            else
            dim correct_password as c
            DIM level AS N

            correct_password = lookup("[PathAlias.ADB_Path]\user_names","session.user_name=" + quote(user_name),"password")

            ELSE
            currentform.has_error = .t.
            currentform.error_message = "Invalid user name or password."
            end if
            end if


            In my AFTERVAlidate code I have this:

            level = lookup("[PathAlias.ADB_Path]\user_names","session.user_name=" + quote(user_name),"level")
            session.__protected__SecurityLevel = level
            session.__protected__UserName = session.user_name

            session.__Protected__Logged_In = .t.
            if eval_valid("session.targetUrl") then
            if session.targetURL <> "" then
            Currentform.RedirectTarget = session.targetURL
            else
            currentform.redirectTarget = "Main.a5w"
            end if
            else
            currentform.redirectTarget = "Main.a5w"
            end if

            Any help would be appreciated, maybe you or anyone else can see what is causing the error.

            Thanks
            Dale

            Comment


              #21
              The sytax for this statement is wrong both places where it occurs. Its also wrong I see in the previous post that I enclosed in quotes and commented on.

              lookup("[PathAlias.ADB_Path]\user_names","session.user_name=" + quote(user_name),"password")

              Specically,

              "session.user_name=" + quote(user_name)


              is in reverse order.
              Steve Wood
              See my profile on IADN

              Comment


                #22
                Steve

                I am not sure what you mean with your last post and am quickly becoming frustrated with the whole thing. Not with you because I know you are doing your best to help me out. It just so blasted confusing because I know so little about programing, what goes where, what can do what etc.

                I think at least for tonight I am done with it before I have a nuclear meltdown. I will work with it some more later but right now I need to stop as I am making no headway at all.

                Thanks again for the help we will talk about this again I am sure

                Dale

                Comment


                  #23
                  "session.user_name=" + quote(user_name)

                  should be

                  "user_name=" + quote(session.user_name)

                  I could see your frustration. I did not mean to avoid 'giving' you the exact answer in the previous post. But its because of how you are approaching things that you are frustrated. Programming is complex. A new programming environment is difficult to master, but especially so if you do not have a programming background. Functions, methods, events and that nasty syntax with quotes and plus signs. I mean it still drives me crazy, it really does! I have years of programming experience but only 2-1/2 with Alpha. Early on, something that now seems as straight forward as "user_name=" + quote(session.user_name) just drove me insane.

                  You are biting off a significant amount all at once. Login and security and audits. It takes time "in the trenches" to be able to work efficiently, tracking down code errors, writing them properly and efficiently scanning that never ending Help documentation. I still spend 1/3rd of my time figuring out what I did wrong or just plain perplexed.

                  But you have to admit, it is exciting!

                  Take a step back. Learn Xbasic as a language. Understand what you are writing word-by-word and as a whole. There is no short cut in that area.

                  If you don't do that, besides being frustrated, the results can be disastrous. Remember, you are working on something that is (or may be) exposed on the world wide web. Google and the others will immediately begin to index every page of your application. Every hour your site will be hit by "spiders" searching for something. Most are innocent, some are malicious. You will find this when you add auditing to your WAS application; dozens of "hits" per day.

                  So take a step back. It is as overwhelming as it seems!

                  p.s. If you are interested, I'll offer you some free training in a couple areas.
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #24
                    I will definately take you up on the training as I move along in my progress with programming and Alpha, specifically.

                    Any ideas as to where I could get some good basic information about Xbasic as I know this is my biggest problem area. I am trying to do things that I have no comprehension of, and trying to figure it out, without understanding it is pointless.

                    So if you could point me to a good starting area I would appreciate it.

                    Thanks again Steve you have helped me out alot

                    Dale

                    Comment


                      #25
                      Start with the tutorial in the standard Help file - even though its well written you need to read it ten times before it starts to make sense. Also check the forum for the name Susan Bush for her Alpha books. Also www.learn alpha.com for Peter Wayne's good set of articles and books. Click Store on the Alpha company site and look for books and material. Also find their archive of newsletters. I have a section on my website for Alpha tips, but it is still completely blank for lack of time!
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #26
                        Hey tried what you suggested and it worked perfectly.

                        Thanks for all of the help, now if I start learning XBasic I will eventually know what and why I am doing things.

                        Thanks again for all the help Steve.

                        Dale

                        Comment

                        Working...
                        X