Automatic user switch after timeout

I’m trying to set up a client event script, under timer, that will log out the user admin and log in the operator user. user and operator are the only two users.

i have
Check Inactivity @5,000ms

if system.util.getInactivitySeconds() > 300:
system.security.switchUser(Operator,operator,1)

Thanks.

Here’s the script I currently use:

[code]

Check to see how long since any keyboard or mouse activity from the user and

if longer than 5 minutes lock the screen

if system.util.getInactivitySeconds() > 300 and system.security.getUsername()!= “user”:
if system.nav.getCurrentWindow() == “Main Windows/Setup”:
system.nav.swapTo(“Main Windows/Main”)
system.security.switchUser(“user”,“user”)
else:
system.security.switchUser(“user”,“user”)[/code]

If a logged in user is in the setup screen, it will swap back to the mail window and revert back to ‘user’. Otherwise, it will just revert back to ‘user’
EDIT: Looking at what you have, it looks very close. You just need to put the username and password in quotes. :slight_smile:

1 Like

thank you, I think the quotes is really all I needed haha