In this video, we will demonstrate how to create your own custom Auto Logout function using a variable timer for your Target security
To begin first create a Security group and a user with username "test" with password "test"
Remember to enable Target Security by changing the setting to "Use Security"
To help demonstrate our feature, let's drag on a Login part from the toolchest
To help keep track of the time before an Auto Log Out occurs, we will need two INT variables "Time" and "AutoLogoutThreshold"
For the initial "AutoLogoutThreshold", we will set it to be 10 seconds as the default
To help monitor "Timer" and help set "AutoLogoutThreshold" on-the-fly, we will draw two numeric displays
Now We will create two Actions to help do the actual task of the AutoLogOut
First we will create an Action with "Trigger Type" set to "Event" and "Trigger Event" set to "When Touch Panel"
Next we will set our Timer variable to 0. This Will help keep the system logged in while there is still activity
For our next operation, we will make a "Decision" operation. It will compare the actual Timer to the desired AutoLogoutThreshold
If "Timer" is less than "AutoLogoutThreshold" we will continue to increment "Timer"
When "Timer" is greater than "AutoLogoutThreshold", we will execute the Sys.logout(); script and reset "Timer" to 0
Now our project is completed
Let's simulate the project to see it in action
First we should login as "test" with password as "test"
Notice when we login, "Current User" is set to "test"
Now let's watch our "Timer" variable and the "Current User" in the object
When "Timer" reaches the threshold, notice "Current User" becomes none. This means we are logged out
Next we will set our "AutoLogoutThreshold" to 15 seconds and repeat the same test
Again when "Timer" reached 15 seconds, the system automatially logged out
Now let's try something shorter like 5 seconds
Notice how "Timer" resets when we press on the panel. This is to ensure the system remains logged in while we are working on it.