Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Forcing a user logout

0 views
Skip to first unread message

Joe

unread,
Apr 9, 2001, 2:37:08 PM4/9/01
to
Hi All,

Here is my situation - I have written a multi-user helpdesk type
application in which I keep track of who is logged in, how many users
there are and what processes they are running. Since I limit the
number of sessions allowed, there are times when I would like to be
able to force a user out of the application (one that has gone home
for the evening...) without physically visiting their PC. I realize
that I could use pcAnywhere or a similar product to take over their
PC, but I'd like to know if it is possible to do this programmatically
in VFP 6.

Any help is greatly appreciated.

Joe


John Spiegel

unread,
Apr 9, 2001, 4:09:22 PM4/9/01
to
Hi Joe,

How about a timer in the app that polls for some value? For example, say
you've got a table that has an entry for each logged in user. In this table
add a DateTime column, ForceLogout. Let's say you want that user to auto
log off at 7:00 p.m. Fill in that user's ForceLogout entry as 7:00 that
night. On the client side have the timer set to check the value in the
user's ForceLogout field set at a long interval like 30000. When the time
comes, pop up a window letting them know they've got X minutes to finish up
before they are automatically logged out. Note that you probably with a
timer in the window to close itself since it's likely there's no user
sitting there to get the warning--it's just good practice in case someone IS
there.

HTH,

John


"Joe" <j...@earthlink.net> wrote in message
news:3ad1fdce....@news.earthlink.net...

Stefan Wuebbe

unread,
Apr 9, 2001, 4:46:21 PM4/9/01
to
Hi,
One way could be creating a flag (file)
in a common directory and let each app
check for it in a timer event frequently.

hth
-Stefan

"Joe" <j...@earthlink.net> schrieb im Newsbeitrag
news:3ad1fdce....@news.earthlink.net...

speakeasy

unread,
Apr 9, 2001, 9:53:09 PM4/9/01
to
here is something I use which does the trick (most of the time)

in my startup .prg
I put this.
f_shutdown="somenetworkfile" && accessable by all users.

If file(f_shutdown)
? chr(7)
Wait window ;
"A request to shutdown has been issued .... ";
timeout 5
Close data
Quit
Clear events
Endif

&& Then.
&& after the read events. in the main .prg
put this.


Define class ForceShutdown as Timer
Interval = 60000
Name = "ForceShutdown"
Procedure Timer
If file(f_shutdown)
? chr(7)
Wait window ;
"A request to shutdown has been issued .... ";
timeout 5
Close data
Quit
Clear events
Endif
Endproc
Enddefine

this proceedure works, as long as the user does not have the application in
the task bar, I have not figured out a way to fix that.
if you do, I would love it.

Bob Lee

"Joe" <j...@earthlink.net> wrote in message
news:3ad1fdce....@news.earthlink.net...

MAppell917

unread,
Apr 9, 2001, 11:12:57 PM4/9/01
to
Yes,

it's possible. I have successfully done it. I have an common timer routine.
I use it for this as well as sending instant messages and notifying users if
they have Email. I start it with a very general flag that merely tells the
interrupt routine whether or not that machine has a "notification" at all (ie:
ForceOff, Email, Instant Message etc.). If there is a notification I then
check to see what the machine needs to check for. In this way, very little CPU
time is wasted regardless of how often the timer is called. I call the timer
every 3 seconds but allow the user to adjust that to their preference.

In order to optimize the routine for speed, I have a 250 byte character string.
Each byte in the string represents a machine number (1 to 250 users). I then
simply check the byte number for a Y for yes or N for no). If it contains a Y,
I can then do a LOCATE or whatever I need to do since that routine does have a
notification (ie: force logoff, instant message, etc). If I tried to do a
LOCATE every instance in a timer, it would be too slow so I only do it when
it's necessary. This optimizes the routine.

Regards.


>Subject: Re: Forcing a user logout
>From: "Stefan Wuebbe" stefan...@gmx.de
>Date: 4/9/2001 1:46 PM Pacific Daylight Time
>Message-id: <OBICXbTwAHA.1304@tkmsftngp02>


Mike

Joe

unread,
Apr 10, 2001, 1:58:32 PM4/10/01
to
First of all, I want to thank you and the others for responding. I
now have a simple routine in my application which an administrator can
use to cleanly log out any user, any time.

As for your sample below not working correctly if the application is
"in the task bar", I have not encountered it. I assume you mean they
have the app minimized, correct?

Anyway, here is what I have done, at least conceptually. My app was
already keeping track of users in terms of a session number that is
assigned upon startup and the user name they logged in under. I use
two files, "sessions" and session_procs". "Sessions" controls and
limits concurrent users and "session_procs" just tracks the processes
they are in.

I created a timer object on the main menu which checks the user's
session_procs every 60 seconds looking for a process called "LOGOUT".
The only way a user gets this process is if an administrator has
issued a forced logout on that session via a special utility screen.
If the timer event finds this process, it pops up a wait window,
removes the "LOGOUT" process record and then calls the click event of
the main menu's exit command. The routine works fine even when the
application is minimized.

Again, thanks to all for the assistance.

Joe

On Mon, 9 Apr 2001 21:53:09 -0400, "speakeasy" <bob...@speakeasy.org>
wrote:

0 new messages