SEBWIN-226: Added mapping for kiosk mode configuration.
This commit is contained in:
parent
29b99d8830
commit
1625e7fa2b
4 changed files with 43 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using SafeExamBrowser.Contracts.Configuration.Settings;
|
||||
|
||||
namespace SafeExamBrowser.Configuration.ConfigurationData
|
||||
{
|
||||
internal partial class DataMapper
|
||||
{
|
||||
private void MapKioskMode(IDictionary<string, object> rawData, Settings settings)
|
||||
{
|
||||
var hasCreateNewDesktop = rawData.TryGetValue(Keys.Security.KioskModeCreateNewDesktop, out var createNewDesktop);
|
||||
var hasDisableExplorerShell = rawData.TryGetValue(Keys.Security.KioskModeCreateNewDesktop, out var disableExplorerShell);
|
||||
|
||||
if (hasDisableExplorerShell && disableExplorerShell as bool? == true)
|
||||
{
|
||||
settings.KioskMode = KioskMode.DisableExplorerShell;
|
||||
}
|
||||
|
||||
if (hasCreateNewDesktop && createNewDesktop as bool? == true)
|
||||
{
|
||||
settings.KioskMode = KioskMode.CreateNewDesktop;
|
||||
}
|
||||
|
||||
if (hasCreateNewDesktop && hasDisableExplorerShell && createNewDesktop as bool? == false && disableExplorerShell as bool? == false)
|
||||
{
|
||||
settings.KioskMode = KioskMode.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
|||
Map(item.Key, item.Value, settings);
|
||||
}
|
||||
|
||||
MapKioskMode(rawData, settings);
|
||||
MapUserAgentMode(rawData, settings);
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,8 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
|||
|
||||
internal static class Security
|
||||
{
|
||||
internal const string KioskModeCreateNewDesktop = "createNewDesktop";
|
||||
internal const string KioskModeDisableExplorerShell = "killExplorerShell";
|
||||
}
|
||||
|
||||
internal static class UserInterface
|
||||
|
|
|
@ -84,6 +84,9 @@
|
|||
<Compile Include="ConfigurationData\DataMapper.UserInterface.cs">
|
||||
<DependentUpon>DataMapper.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ConfigurationData\DataMapper.Security.cs">
|
||||
<DependentUpon>DataMapper.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Cryptography\HashAlgorithm.cs" />
|
||||
<Compile Include="DataFormats\XmlElement.cs" />
|
||||
<Compile Include="DataFormats\XmlParser.cs" />
|
||||
|
|
Loading…
Reference in a new issue