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's on First?

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

  • Who's on First?

    Is there a function I can use to return a list of all the users currently logged on to the application?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  • #2
    Re: Who's on First?

    I don't think it is possible unless you create and constantly update your own table of currently logged on users. A5_GET_USERS("your master password") would get a list of all defined users in A5's security system, but that is not what you want. Also, the trouble with using your own table is that it is not fool proof, e.g. if one exits A5 via Ctrl+Alt+Del, etc. the user would be listed as logged on when he/she is not.

    Raymond Lyons

    Edit: BTW, Who is on first!

    Comment


    • #3
      Re: Who's on First?

      Hi Raymond,

      Thanks for reply. I needed to add some extra fields to an app remotely but somebody on the network using TS did not log out and the boss wanted to know who it was. Any suggestions as to how best to code that?

      Who's on First.
      Regards
      Keith Hubert
      Alpha Guild Member
      London.
      KHDB Management Systems
      Skype = keith.hubert


      For your day-to-day Needs, you Need an Alpha Database!

      Comment


      • #4
        Re: Who's on First?

        Keith,
        See A5_REGISTRATION_LICENSE_INUSE().

        Also, if you want to keep track of users it can be done in xbasic with a table and much closer control control of the logon and logoff process.

        Comment


        • #5
          Re: Who's on First?

          A5_REGISTRATION_LICENSE_INUSE() is not going to tell you who is still logged on, just that someone is. As I said (and Garry said again) you can create a table of when each user logs on and delete them when they log off, but as I said it is not foolproof due to creative (!) ways of exiting an application.

          If you have access to the network file server, you can use administrative tools to go to "open files" and see who still has the files open (I do not remember the exact way to do this but it is fairly obvious). While there you can also close that person down (close the open files, presuming they are not actually working at the time) and then add your extra fields or whatever. I have had to do this in the middle of the night (remotely) many times in order to do things such as add fields. So far closing those files has never caused any problems.

          Raymond Lyons

          Comment


          • #6
            Re: Who's on First?

            Thanks for your suggestions but I need to see who is logged on now. If the answer is that I cant until I build a routine first then I have a problem.
            Regards
            Keith Hubert
            Alpha Guild Member
            London.
            KHDB Management Systems
            Skype = keith.hubert


            For your day-to-day Needs, you Need an Alpha Database!

            Comment


            • #7
              Re: Who's on First?

              Like I said, you can do it by creating a table in your application of users logged on. When they open the application (autoexec or part of your logon screen) put their name in the table. When they exit the app, delete their name. Or you could have a field for each user, such as On/OFF, date and time etc.--whatever you need/want. Most of the time this would be just what you want--unless there is a crash or someone exits the app in an unanticipated way.

              Now, I have to guess that some windows guru could develop a function that would query the network file server for open files, which lists who has them open--or some such thing. In any case, that would be well beyond my skill set. Possibly it is something for the wish list?

              Finally I seem to remember that in Learnalpha.com (or maybe in the code archive) there was an article years ago on how one might force users to shut down after a certain amount of time went by. For your purposes this might do just as well--assuming it works!

              Raymond Lyons

              Comment


              • #8
                Re: Who's on First?

                I developed a system like that for a hospital in Version 5, and have been using it ever since.

                I use a table that shows the computer name, location, department, username, and time on initialized from the autoexec when they log on - via their password.

                Then I have a global variable called "lastuse" that is refreshed from the onkey event in forms, and another global variable for how long a workstation may remain open without any activity. When the time limit is reached, a floating xdialog appears and sends a wav advising them of same and a reverse counter showing them that unless they use the keboard (or fetch with the mouse, etc.,) the system will auto shutdown in so many seconds. At that point a function does a safe, methodical closing of all screens and closes Alpha.

                The practical reason for developing this was/is that they have the program installed on 250 workstations, but have a 10 user runtime. And emergencies and such often call a tech/nurse away from a keyboard to attend to something.

                The Master Menu has a button "Users on the Network" that sends out a request to all workstations, displaying a screen of logged on users, and after about 30 seconds all currently on will light up in green, and all those not, (who had an abnormal-end-or-session) will remain in red.

                It is foolproof to this extent - it will always show all current users, and when they logged on, as well as the machinename, etc. And what I have found to be very valuable is to watch/track for certain machines and/or users where they have frequent abnormal-end-of-sessions, as this points to either a problem user or problem machine.

                I use it on almost all my apps for all clients. For all LANS and T/S it helps maintain the least number of necessary users with the app open.

                If the Rangers beat the Yankees again tonight, I'll put a smaple app in the code archive.
                Cole Custom Programming - Terrell, Texas
                972 524 8714
                [email protected]

                ____________________
                "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                Comment


                • #9
                  Re: Who's on First?

                  With a little different approach, we have developed a couple of routines that when used together will knock users out of the system. One of our utility tables has a field that we can set which is tested for, and will initiate an emergency close of Alpha, wherever the user is. Steve Andrews set up a self-scheduling script that tests this field, and if it is found, commits the form and closes alpha.

                  Script: scpCheck_Closeit

                  Code:
                  dim global cTime_Chck as C
                  dim global nTime_Slot as N
                  nTime_Slot = 1
                  
                  closeit()
                  'fuction varinit() is an internal function of ours that establishes a whole bunch of global and addin variables
                  'varinit()
                  cTime_Chck = totime(toseconds(time("0h:0m",now()))+120,1,0)
                  script_schedule("scpCheck_Closeit",cTime_Chck,nTime_Slot)
                  Function: closeit()
                  Code:
                  FUNCTION closeit AS V ( )
                  dim aa as P
                  aa = addin.variables()
                  
                  'Closeit is a function used to determine if we need to close out a user.  We test a flag in the 
                  ' indicator table, and if set, end the session.  We should also check to see if the user has a change
                  ' or enter in progress and save the data if so.    This function should be attached to every form's "on_timer" event
                  
                  dim closeit as C
                  closeit = upper(lookupc("F",1,"closeit",aa.bcbss.path+"\bcbss\indicato.dbf","recno"))
                  
                  if UT(closeit) = "X"
                  	'system problems,  get out now
                  	closemsg(.T.)
                  	sleep(3)
                  	closemsg(.F.)
                  'check for open tables and commit form if in change or enter mode
                  		tbl1 = table.current()
                  		if tbl1.mode_get()>0
                  			parentform.Commit()
                  		end if
                  '*******  This code checks and updates our internal security table
                  		'clear user lock flag
                  		access = aa.bcbss.access
                  		level = aa.bcbss.level
                  
                  		TBL_SECURE = table.open(aa.bcbss.path+chr(92)+"secure2.dbf")
                  		TBL_SECURE.index_primary_put("ACCESS")
                  		recno=TBL_SECURE.fetch_find(ACCESS)
                  		TBL_SECURE.change_begin()
                  			tbl_secure.active=""
                  			tbl_secure.activetime=""	
                  		TBL_SECURE.change_end(.T.)
                  		
                  'now close it		
                  		:a5.close()
                  	end if
                  end if
                  
                  end
                  END FUNCTION
                  Function: CLOSEMSG
                  Code:
                  FUNCTION CLOSEMSG AS C (Show = .F.,what = "" )
                  'DESCRIPTION: This function displays a 'Please Wait' dialog for use while processing.	
                  'What is an optional parameter that will be displayed along with the words "Please Wait"
                  PleaseWait = ""
                  
                  if show = .F.
                  	if ui_modeless_dlg_exist("BCBSS Shutdown")
                  		ui_modeless_dlg_close("BCBSS Shutdown")
                  	end if 
                  	exit function
                  end if
                  
                  text1 = "Social Services Must Shut Down Now!"
                   	len = len(text1)*2
                  textbox="{text="+alltrim(str(len))+"text1}"
                  
                  box_code = <<%dlg%
                  	{background=Pale Yellow}
                  	{font=arial,12,bi}
                  	{include=textbox}     
                  %dlg%
                  
                  box_event = <<%code%
                  1=1
                  %code%
                  
                  ui_modeless_dlg_box("BCBSS Shutdown",box_code,box_event)
                  ui_dlg_move("BCBSS Shutdown", 2, 2.5)
                  
                  ui_modeless_dlg_setfocus("BCBSS Shutdown")
                  ui_modeless_dlg_refresh("BCBSS Shutdown")
                  
                  END FUNCTION
                  This may not give you the culprit, but it will get them out!:)

                  Tom
                  Last edited by Tom Henkel; 08-12-2010, 12:06 PM. Reason: add "closemsg" Function

                  Comment


                  • #10
                    Re: Who's on First?

                    Hi Tom,

                    Thanks for this script.

                    I have already something like this from Peter Wayne but it does not knock people off from TS.

                    Would this script accomplish that?
                    Regards
                    Keith Hubert
                    Alpha Guild Member
                    London.
                    KHDB Management Systems
                    Skype = keith.hubert


                    For your day-to-day Needs, you Need an Alpha Database!

                    Comment


                    • #11
                      Re: Who's on First?

                      Hi Keith,

                      We don't use Terminal Server, but I know it knocks them out of Alpha. How does Terminal Server view an Alpha Session? If it behaves like a runtime session, the script would go in the autoexec and the functions are in the database. We have people who come in in the morning, bring up the application, load the customer information form and leave it there all day. Of course, they are never at their desk when we need them to be. With ~200 users, we needed something to knock people out of the system if we ever need to do some emergency maintenance. I've just recently put together an "idle_check" function to see if someone is just sitting on a screen for more than 20 minutes. If so, bye-bye.

                      Tom

                      Comment


                      • #12
                        Re: Who's on First?

                        If you log on with TS you can hit Cntrl Alt, End and restart the server, that will close or not open their session when it restarts. I do it all the time.

                        Comment


                        • #13
                          Re: Who's on First?

                          if a5_is_runtime() .and. a5.Get_Master_Path()="" 'T/S
                          sys_shell("shutdown /L")
                          a5.close()
                          end
                          else
                          a5.close()
                          end
                          end if
                          Cole Custom Programming - Terrell, Texas
                          972 524 8714
                          [email protected]

                          ____________________
                          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                          Comment


                          • #14
                            Re: Who's on First?

                            here's a network management app, for consideration:

                            the password is martin3333
                            its first use will require you add your machine to the system

                            the opening screen explains its use
                            Cole Custom Programming - Terrell, Texas
                            972 524 8714
                            [email protected]

                            ____________________
                            "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                            Comment

                            Working...
                            X