SEBWIN-426: Ensured that lock screen is not activated when lock or switch session is allowed.

This commit is contained in:
Damian Büchel 2020-10-23 09:31:23 +02:00
parent f6a3cb485b
commit 3ef3bccd7e

View file

@ -590,11 +590,18 @@ namespace SafeExamBrowser.Client
private void SystemMonitor_SessionSwitched() private void SystemMonitor_SessionSwitched()
{ {
var allow = !Settings.Service.IgnoreService && (!Settings.Service.DisableUserLock || !Settings.Service.DisableUserSwitch);
var message = text.Get(TextKey.LockScreen_UserSessionMessage); var message = text.Get(TextKey.LockScreen_UserSessionMessage);
var title = text.Get(TextKey.LockScreen_Title); var title = text.Get(TextKey.LockScreen_Title);
var continueOption = new LockScreenOption { Text = text.Get(TextKey.LockScreen_UserSessionContinueOption) }; var continueOption = new LockScreenOption { Text = text.Get(TextKey.LockScreen_UserSessionContinueOption) };
var terminateOption = new LockScreenOption { Text = text.Get(TextKey.LockScreen_UserSessionTerminateOption) }; var terminateOption = new LockScreenOption { Text = text.Get(TextKey.LockScreen_UserSessionTerminateOption) };
if (allow)
{
logger.Info("Detected user session switch, but user lock and/or user switch are allowed.");
}
else
{
logger.Warn("Detected user session switch!"); logger.Warn("Detected user session switch!");
if (!sessionLocked) if (!sessionLocked)
@ -616,6 +623,7 @@ namespace SafeExamBrowser.Client
logger.Info("Lock screen is already active."); logger.Info("Lock screen is already active.");
} }
} }
}
private void TerminationActivator_Activated() private void TerminationActivator_Activated()
{ {