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

Who is logged in?

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

    Who is logged in?

    Customers of our web application www.promatainer.com have asked me to add the functionality to display the names of the users that are currently logged into the the application.

    I have tried several approaches without success. The application is written in A5 V10.5. Is there a solution to add this functionality in our web application?

    Andy Sigrist

    #2
    Re: Who is logged in?

    It is pretty easy to collect who has (recently) logged in, but not who is currently logged in. To get who has logged in, put something like this on your Login.a5w page:

    If eval_valid("submitbutton")
    ' code to store the userid to a table along with timestamp
    ' "userid" is a real variable name that will hold what the user entered in the Username Login Dialog field.
    end if

    That tells you who logged in, and when. If you could mandate that they click your logout button to end their session, you could assume that everyone that logged in, but has not logged out, is current. But a large percentage will just close their browser. So you can put code on your logout.a5w page to delete them from the above table (or flag them as logged out), but you can also check for 'recent activity' to see if they are still logged in.

    A normal user will refresh pages and run some routines. Pick a few important ones and add some code that updates the above table to indicate they are 'still logged in' by updating the timestamp. You could guess that anyone with a timestamp older than XX hours is no longer logged in.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Who is logged in?

      Steve,

      thank you for your help with this. I will add the code to the Login.A5w page and incorporate some of your other suggestions. At the same time I am surprised that it is not easy to display "who is logged in". I thought that this would be a common request from users of Alpha 5 applications and that Alpha Software would have provided a function for this. Maybe it will come in a future release.

      Andy Sigrist

      Comment


        #4
        Re: Who is logged in?

        Originally posted by Sigrist View Post
        At the same time I am surprised that it is not easy to display "who is logged in". I thought that this would be a common request from users of Alpha 5 applications and that Alpha Software would have provided a function for this. Maybe it will come in a future release.
        Alpha web security configuration has a check box to track who logs in & out. It sends the data to a text file on your server. It also gives you the option to send the results to a custom UDF to do whatever you want. Of course, as Steve says, there is no way to know if a user is still logged in (unless they actually logged out), if their session has expired, if they closed the browser window, if they took a sledge hammer to their computer, or if they jumped out of their apartment window. That's not an Alpha limitation, that's a web browser "feature".
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


          #5
          Re: Who is logged in?

          Peter - I forgot about that checkbox. I think Alpha is not going to enhance the security model since they are eventually going to an IIS model and that would obviate all of the security framework methods.
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Re: Who is logged in?

            Originally posted by Steve Wood View Post
            ...and that would obviate all of the security framework methods.
            RATZ!!!
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              Re: Who is logged in?

              Appreciate all your help and feedback. Thank you for the detailed explanations.

              Andy

              Comment


                #8
                Re: Who is logged in?

                Ok, I am still struggling to implement the suggestion

                If eval_valid("submitbutton")
                ' code to store the userid to a table along with timestamp
                ' "userid" is a real variable name that will hold what the user entered in the Username Login Dialog field.
                end if

                I did put it into the Login.A5w page. Couple of questions:

                To populate the Userid field, is there a system variable that I can access that holds the User ID?
                Do I need to sbustitute a different name or variable for "submitbutton"?

                Ideally, is there an application example where I can see this implemented? This would help me the most.

                Appreciate all help on this.

                Andy

                Comment


                  #9
                  Re: Who is logged in?

                  Steve's code will work. userid is Alpha's variable name in the login dialog component. submitbutton refers to the login button itself when clicked.
                  Peter
                  AlphaBase Solutions, LLC

                  [email protected]
                  https://www.alphabasesolutions.com


                  Comment


                    #10
                    Re: Who is logged in?

                    Peter,

                    thank you for your help. I think I am almost there, but appreciate if you can review what I have done so far and let me know what I am doing wrong.

                    - I created a file Web_Log.dbf. (attached Picture 1)
                    - On the Login.A5w page, I added Xbasic code (attached Picture 2)

                    The actual text of the XBasic code is shown below:

                    if eval_valid("submitbutton")
                    tbl = table.open("Web_Log")
                    tbl.enter_begin()
                    tbl.Userlogin = userid
                    tbl.Logindate = Date()
                    tbl.logintime = Time()
                    tbl.enter_end()
                    tbl.close()
                    end if

                    Two problems remain. First, the If condition does never execute. Second, the variable "userid" is not recognized.

                    Sincerely

                    Andy Sigrist

                    A5 Screen Print.jpgA5 Screen Print 1.jpg

                    Comment


                      #11
                      Re: Who is logged in?

                      You first need to confirm that the IF statement is true. Put something like save_to_file("got here","c:\test.txt") inside the IF statement to see if you get a file. Your second line should be tbl = table.open("[PathAlias.ADB_Path]\Web_Log") and your table field type to store the Time value is incorrect.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: Who is logged in?

                        Are you using Alpha's login component or did you hand create your own?
                        Peter
                        AlphaBase Solutions, LLC

                        [email protected]
                        https://www.alphabasesolutions.com


                        Comment


                          #13
                          Re: Who is logged in?

                          Steve, Peter,

                          thank you for all your help with this. I tried the suggestions today - without positive results - and here is my feedback:

                          [LIST][*]The login component is Alpha's login component. See attached picture.[*]The IF statement does not work. It does not apprear to detect the submitbutton. The test file is not being created.[*]If I comment the IF statement out, and comment the "tbl.Userlogin = userid" out (to prevent an error), a record is successfully added in Web_Log.Dbf with the time and date (the "Short Time" field does appear to work). The test text file is also being created.

                          A5 Screen Print 2.jpg

                          It appears that the Xbasic script is not able to reference or see the "Submitbutton" or "Userid" variables. What am I missing? Is it ok to have the Xbasic Code Block on the A5W page, or should this block be in a different location?

                          I am so close with this and hope to finally solve it. Appreciate any help on this.

                          Andy Sigrist

                          Comment


                            #14
                            Re: Who is logged in?

                            Originally posted by Steve Wood View Post
                            Peter - I forgot about that checkbox. I think Alpha is not going to enhance the security model since they are eventually going to an IIS model and that would obviate all of the security framework methods.
                            I don't think A5V11 IIS will be free but you have to pay for it as feature pack when launched

                            Comment


                              #15
                              Re: Who is logged in?

                              I confirmed that this works both in V10 and V11. So, last observation, go to the A5W page source and move your entire code block to the very top of the page, above the <DOCTYPE>, like in my similar example attached.
                              Attached Files
                              Steve Wood
                              See my profile on IADN

                              Comment

                              Working...
                              X