|Subject||Re: [IBO] Controlling amount of users logged in|
> 1) What I want to do is only allow a certain amount of users toBeen there :-)
> access the program at once.
> 2) My other concern is what happens if the machine bombs out and the
> logged in flag never gets reset, how do I know if the logged in flag
> is still valid.
> Any help and suggestions would be much appreciated.
I chose to modify the ISC4.GDB security database to support this,
every user actually gets two logons - the second/internal one
maintained by the user management form automatically.
It is possible to obtain the path to the isc4 automatically
(from TIB_Session.GetISC4Path). This allows me to automatically get
setup a connection, connect to the ISC4 database and run a procedure,
that procedure returns the database file name for the "real"
connection to be made later.
The first/user known logon only has access to the ISC4 database and
the ability to execute the logon procedure. That procedure does some
internal checking (as to whether the user appears to be already logged
on etc) and returns the appropriate internal logon name (that has the
same password as the original logon, but has access to the application
database) database and a unique (generated) session id.
On logoff/exit an exit procedure is run against the ISC4 database to
clean up the details added during logon.
IMPORTANT: You need to take special attention if runing under
terminal server, because a users on the terminal server will appear
to be coming from the same machine (so I use the automatic session id
provided by terminal server as an addition identifier).
Then you come to your problem #2. It has been my plan to setup a
timer mechanism that runs in the background and generates a
"heartbeat" to the isc4 database. If this heartbeat is not received
a server based service will clean up "old" logon details. That plan
has been in place for a few years now and never eventuated.
You see I gave the application administrator a form to manually clean
up logons left after machine failures. Courtesy of IBO, Terminal
Server and very tight security controls, the systems have been very
stable and cleanups only needed occassionally. So the admin has been
happy to do this manually on the few occassions its required.