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 Component

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

    #16
    Re: Login Component

    A new option has been added to Alpha Five V8 that should show up in the next build.

    The security settings form now has a field to enter a session variable name for the 'ulink' value. If security is active, the 'ulink' option is active, and a name is specified, a session variable with that name will always exist. It will have a blank value if no one is logged in and will have the 'ulink' value from a logged in user. This session variable can then be used in an argument for filters or other purposes.

    If a session times out, the next page request will recreate the variable if the 'ulink' option is active and a name is specified. If someone is still logged in (login spans beyond sessions), the session variable will be automatically re-populated with the 'ulink' value from their security record. If the security framework is off, the variable will NOT exist as all security code is skipped.

    You could then use whatever code is appropriate for your needs to get other values from an external table or apply filters.

    Comment


      #17
      Re: Login Component

      Thanks Jerry,

      Is there any advantage to using the ulink versus the userid as the unique identifier to relate to the external users list? The userid is a unique value such as email or other ID that is created at the time the user is added.

      I can see the ulink value being necessary when you have more than one login for a given user (three userid's all with the same ulink). But beyond that, in the times I have used ulink, the value tends to be the same as the userid, meaming it would be less administrative work to just use the userid and omit the ulink.
      Steve Wood
      See my profile on IADN

      Comment


        #18
        Re: Login Component

        Jerry,

        Thank you for making this happen. It will be a useful and time saving feature.

        Steve...

        In the application I am working on, I have set the ULink field to match the account number of the customer. When someone logs in, I use the value in ULink to open my customer table and write their account number to a session variable which is in-turn used to filter records to those belonging to that specific customer.

        Now, I can completly skip the step of opening the table and writing the account number to a variable (this is done now through an intermediate page).

        This will also resolve any redirect issues that I was going to be facing. Now, if a user navigates to a login required page without being logged in, the security framework will process the login and then redirect to the originally requested page.

        So...in this specific case, I am glad to see the ULink being used to populate the variable as opposed to the User_Id. I can however imagine circumstances where the User_Id or even the Email_Address could be used for similar purposes.

        Again Jerry, thank you for being so responsive.

        Louis

        Comment


          #19
          Re: Login Component

          Hi,

          This is day 1 for me using the new v8 web security feature. I have reas many posts, but i am a bit confused with the Ulink or UserID feature.

          When a user logs in, I am trying to populate the page with their name. e.g. Mr John Smith is logged in. My intermediate page from Pat looks like this

          Code:
          <%a5
          '==== Get logged in user id code
          dim pUser as p
          Dim tbl as p
          a5ws_logged_in_user_values(pUser,request,session)
          if eval_valid("pUser.ulink") = .t.
           vUI=alltrim(pUser.ulink)
           tbl=table.open("[PathAlias.ADB_Path]\Staff")
           tbl.order("User_ID","User_ID = "+quote(vUI))
           session.__protected__UserId = vUI
           session.__protected__UserName = alltrim(tbl.Full_Name)
           tbl.close()
          end if
          response.redirect("Menu.a5w")
          %>
          and my web page identifier looks like this

          Currently
          logged in user&nbsp;: <%a5 ? session.__protected__UserName %>

          The issue i have is the page is not picking up the correct user name. It seems to default to the first user in the table only.

          I have also attached some screen shots of my config page and user setup.

          Can anyone offer any tips to get tis working?

          Denis

          Comment


            #20
            Re: Login Component

            In your Staff table, is the UserID value for user "d" really the word "pUser"? If the UserID is "001", then the Ulink value in the security should be "001".

            Also, caution using an intermediate page (between login and first viewable page). If the user goes to "www.yourdomain.com/thisotherpage.a5w", and are by security redirected back to the login page, after they login they will go straight back to thisotherpage.a5w, skipping your intermediate page. You can break that action, but I forget how.

            I use the following on my Header to show who is logged in. Because this page fires on EVERY page, it makes sure the values are reset every time. So its like an intermediate page, on every refresh. The only thing fancy is where it puts in a comma if the Company Name exists, like "Steve Wood, AlphaToGo". The variables don't need to be session variables (other than the ulink) unless you want to use them elsewhere in the application while they are logged in.

            The important thing to note here is the ulink variable. It ALWAYS exists as long as someone is logged in. That's a feature of the Security Framework. So I can use it with some assurance.


            Code:
            IF eval_valid("session.__protected__ulink")
            	IF session.__protected__ulink  "" THEN
            		session.co_name = alltrim(lookupc("F",alltrim(session.__protected__ulink),"Company_name","[PathAlias.ADB_Path]\users_company","Company_No"))
            		session.fname 	= alltrim(lookupc("F",alltrim(session.__protected__ulink),"Fname","[PathAlias.ADB_Path]\users","Co_Acct"))
            		session.lname 	= alltrim(lookupc("F",alltrim(session.__protected__ulink),"Lname","[PathAlias.ADB_Path]\users","Co_Acct"))
            		IF session.co_name "" THEN
            			session.co_name = ", " + session.co_name
            		END IF
            		? "Logged in: " + session.fname + " "
            		? session.lname
            		? session.co_name
            	END IF
            END IF
            Steve Wood
            See my profile on IADN

            Comment


              #21
              Re: Login Component

              Thanks for that info Steve.

              I will make try to find the thread explaining how the intermediate page can be reloaded. I am sure i saw it somewhere. If not, i will go plan B.

              Youre right. The pUser should be the UserID field value. I thought i missed something as i will need to maintain that with a table. I just wished it could lookup the user_ID and assign the value automatically.

              Maybe another release.....

              Thanks

              Denis

              Comment


                #22
                Re: Login Component

                It does already. When a person logs in, that value in Ulink WILL exist in a session variable (you have to tell it to do this, and what the variable name is in the Security Framework config). I don't use the "a5ws_logged_in_user_values(pUser,request,session)" method, I use the always-present Ulink to get whatever User info I need at the moment. The Ulink value identifies the Security Framework User record, and also your User table (Staff for your app). So you can always get security or custom info on your logged in user whenever they are logged in.

                What I do is to create my custom User record first. It has an auto-increment ID value. As soon as I create that record, I get the new ID value and then write the Security Framework record, using that ID as the Ulink value. Therefore, the S/F User record and my custom user records are in sync.
                Steve Wood
                See my profile on IADN

                Comment


                  #23
                  Re: Login Component

                  I have just stumbled across this post, firstly appologies for a double entry, as i placed the same question in a new post. But i think its more appropriate to post it here. Maybe ALPHA can delete the single post.

                  I need to do the same thing as Steve as far as the ulink is concerned. I have created a table to hold info re a customer and also want to populate the ulink from the unique autoincrement 'user_id' field in my table.

                  I have been working on this for hours. What i am doing should work, but i cannot see why it is not.

                  When adding a new user via a dialog, I am trying to update the ULINK value based on an Autoincrement field in the 'staff' table (user_id)-CHAR-. In addition to the standard code setup in the 'Adding Users with a Web Component' help file, I have placed the following code in the AfterValidate of the dialog component;


                  Code:
                  Dim t as P
                  t=table.open("[PathAlias.ADB_path]\staff")
                  t.enter_begin()
                  t.Userloginid=userid
                  t.Title=Title
                  t.First_name=First_Name
                  t.Last_name=Last_Name
                  t.Company=Company
                  t.Tel_no=Tel_No
                  t.Email_addr=Email_Addr
                  t.Role_resp=Role_Resp
                  t.Upassword=Password
                  t.Redirectpage=RedirPage
                  t.enter_end(.t.)
                  [COLOR="Red"]ulink = t.User_id[/COLOR]
                  t.close()
                  
                  [B]a5ws_get_user_values(CurrentForm,request)[/B]
                  The bit in bold is the original value as per the help file 'Adding Users with a Web Component' which i followed word for word.

                  After i submit the page and import users in the security section , the user is created and all fields get populated except the ULINK value which remains blank.

                  Can anyone look at the above and see where i have gone wrong.

                  Denis

                  Comment


                    #24
                    Re: Login Component

                    Denis,

                    I could be way off but it sure seems that you would need to save after setting the Ulink value as you saved after setting all the other values.
                    Mike
                    __________________________________________
                    It is only when we forget all our learning that we begin to know.
                    It's not what you look at that matters, it's what you see.
                    Henry David Thoreau
                    __________________________________________



                    Comment


                      #25
                      Re: Login Component

                      Mike,

                      I will give it a go.

                      Denis

                      Comment


                        #26
                        Re: Login Component

                        :) And I was right!! I was way off! The other thread Denis posted this to has the correct answer...


                        http://msgboard.alphasoftware.com/al...ad.php?t=70003

                        Its:

                        ...
                        request.variables.ulink = t.User_ID
                        tbl.close()
                        a5ws_save_user_values(CurrentForm,request)
                        a5ws_get_user_values(CurrentForm,request)


                        And the security framework allows you to NOT need to save the password to your user table like you are in your example. NO ONE SHOULD EVER SEE THE USER'S PASSWORD, EVER. And you don't need it in your user's table.
                        __________________
                        Steve Wood
                        AlphaToGo
                        Mike
                        __________________________________________
                        It is only when we forget all our learning that we begin to know.
                        It's not what you look at that matters, it's what you see.
                        Henry David Thoreau
                        __________________________________________



                        Comment

                        Working...
                        X