User Logoff on Screensaver Activation or SiteKiosk Logout Button Usage for SiteKiosk Online

This script example is suited for environments where SiteKiosk Online is started when users login to the kiosk terminal with their individual accounts instead of the default SiteKiosk user and the terminal should return to the Windows login screen once the user leaves the terminal. In most cases this means domain environments.

Instead of using the standard Auto Start mode from the SiteKiosk Quick Start menu click on "Settings" at Auto Start. Choose “Auto start with shell replacement for all users” and disable “Log on automatically at system startup”.

Then click “Save” and use the “Start” button at Auto Start. This leaves the kiosk terminal at the Windows login screen when turned on, where users can type in their credentials and SiteKiosk Online will start right after the login of the user.

 

In order for the kiosk terminal to return to the Windows login screen either when a user presses the default SiteKiosk logout button or the screensaver activates a custom setting can be added in the Advanced Client settings of SiteKiosk online:

Open your Project (e.g. Browser) on https://sitekiosk.online and go to ">Settings>Client>Advanced"

 

Then press the green "Add setting" button and enter the following in the "Path" input field.

 

system.startupScript

 

And at value insert this script code: 

siteKiosk.onLogoutCompleted(()=>{

 

      __siteKiosk.logoffUser();

 

}); 

 

Press the “Save"button and publish the project.

To test the setting wait for screensaver activation or press the logout out button.

User Logoff on Screensaver Activation or SiteKiosk Logout Button Usage

This script example is suited for environments where SiteKiosk is started when users login to the kiosk terminal with their individual accounts instead of the default SiteKiosk user and the terminal should return to the Windows login screen once the user leaves the terminal. In most cases this means domain environments.

Instead of using the standard Auto Start mode from the SiteKiosk Quick Start menu the Customized mode is used according to the needs of the specific kiosk environment. For example by choosing Run SiteKiosk automatically at Windows startup, unchecking Settings only apply to the restricted SiteKiosk user account and also leaving Disable any keyboard input during startup and Log on automatically at system startup unchecked, this leaves the kiosk terminal at the Windows login screen when turned on, where users can type in their credentials and SiteKiosk will start right after the login of the user.

In order for the kiosk terminal to return to the Windows login screen either when a user presses the default SiteKiosk logout button or the screensaver activates a small script can be added in the configuration tool of SiteKiosk.

The script uses the SiteKiosk Object Model and has this content:

SiteKiosk.OnReset = InitUserLogoff; // Requires the default Screensaver setting to execute a logout to be active

function InitUserLogoff(){
	//Wait 5 seconds to give SiteKiosk time to do the usual screensaver and logout processing, adjust if necessary
	SiteKiosk.Scheduler.AddDelayedEvent(5000, LogoffWindows);
}

function LogoffWindows(){
	//Run the Windows user logoff
	SiteKiosk.LogoffWindows();
}

The script uses the OnReset event to detect the usage of the logout button or the activation of the screensaver. Note that it requires the default screensaver behaviour to execute a logout to be active to work. In case the OnReset event fires, the function InitUserLogoff is called, which uses the AddDelayedEvent method to wait 5 seconds to give SiteKiosk time to perform the usual logout and screensaver actions. You can change the time to match your requirements. After the delay the LogoffWindows function is called, which uses the LogoffWindows method to initiate a Windows logoff while retaining the selected SiteKiosk start settings.

Copy and paste the above code to an editor, e.g. Notepad, and save it as a .js file in the Html subfolder of your SiteKiosk installation (usually located here: C:\Program Files (x86)\SiteKiosk\Html). To add the script to SiteKiosk, go to Start Page & Browser -> Customize -> Advanded and add it as an external script file to be executed on startup of SiteKiosk.