by Roger Seiler » Sat Mar 29, 2008 12:50 am
I do this two ways redundantly. First, I use Protection PLUS which has a range of secure functions for controlling access to an app on a network. Second, I have each user automatically add/activate a record to a user.dbf file when they load the app. So I just count the number of active records (those not marked with an * in a deletion field) to see how many are on. As each user signs off and the the app's exit procedure is processed, a record is automatically deactivated by blanking various data fields and an * is put in the deletion marker field. Records marked for deletion in this way are periodically cleaned out. In this case, records need not be user-specific (not tied to a particular person).
However, in our implementation of the user.dbf file, users sign on to the app with a password that links to another file to grab the user's ID code and name. The ID is put into an indexed field in the user.dbf file, the name into a name field, so that in this usage, each record here is user-specific while the user is signed on. The system operator can look at a list of names of people signed on, and can send a message to any individual or to everyone (perhaps to tell them all to sign off). Each record has a memo field, which is where the message goes. Whenever the user moves around inside the app (takes a menu option or clicks a toolbar button), the program automatically checks to see if the user.dbf memo field for that user has a message in it, and if so displays it.
In a .mem file, we keep track of whether a daily automatic startup routine has been done. If this indicates that user launching the program is the first to sign on for the day, then certain startup maintenance is automatically done, including cleaning out any erroneously "open" records in user.dbf that were left "open" because the app GPF'd.
(For those who don't know the original definition of GPF, it is "Go Pray Faithfully.")
I hope this helps, Patrick.
- Roger