2019-06-21 15:05:31 +02:00
|
|
|
|
/*
|
|
|
|
|
* 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/.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-06-26 10:13:11 +02:00
|
|
|
|
using System;
|
2019-06-21 15:05:31 +02:00
|
|
|
|
using SafeExamBrowser.Contracts.Lockdown;
|
|
|
|
|
using SafeExamBrowser.Contracts.Logging;
|
2019-07-03 08:59:27 +02:00
|
|
|
|
using SafeExamBrowser.Lockdown.FeatureConfigurations.RegistryConfigurations.MachineHive;
|
2019-07-02 10:35:40 +02:00
|
|
|
|
using SafeExamBrowser.Lockdown.FeatureConfigurations.RegistryConfigurations.UserHive;
|
2019-07-10 08:20:07 +02:00
|
|
|
|
using SafeExamBrowser.Lockdown.FeatureConfigurations.ServiceConfigurations;
|
2019-06-21 15:05:31 +02:00
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.Lockdown
|
|
|
|
|
{
|
|
|
|
|
public class FeatureConfigurationFactory : IFeatureConfigurationFactory
|
|
|
|
|
{
|
|
|
|
|
private IModuleLogger logger;
|
|
|
|
|
|
|
|
|
|
public FeatureConfigurationFactory(IModuleLogger logger)
|
|
|
|
|
{
|
|
|
|
|
this.logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 08:59:27 +02:00
|
|
|
|
public IFeatureConfiguration CreateChangePasswordConfiguration(Guid groupId, string sid, string userName)
|
|
|
|
|
{
|
|
|
|
|
return new ChangePasswordConfiguration(groupId, logger.CloneFor(nameof(ChangePasswordConfiguration)), sid, userName);
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-02 10:35:40 +02:00
|
|
|
|
public IFeatureConfiguration CreateChromeNotificationConfiguration(Guid groupId, string sid, string userName)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-07-02 10:35:40 +02:00
|
|
|
|
return new ChromeNotificationConfiguration(groupId, logger.CloneFor(nameof(ChromeNotificationConfiguration)), sid, userName);
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-26 10:13:11 +02:00
|
|
|
|
public IFeatureConfiguration CreateEaseOfAccessConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-06-26 10:13:11 +02:00
|
|
|
|
return new EaseOfAccessConfiguration(groupId, logger.CloneFor(nameof(EaseOfAccessConfiguration)));
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 08:59:27 +02:00
|
|
|
|
public IFeatureConfiguration CreateLockWorkstationConfiguration(Guid groupId, string sid, string userName)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-07-03 08:59:27 +02:00
|
|
|
|
return new LockWorkstationConfiguration(groupId, logger.CloneFor(nameof(LockWorkstationConfiguration)), sid, userName);
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 08:59:27 +02:00
|
|
|
|
public IFeatureConfiguration CreateNetworkOptionsConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-07-03 08:59:27 +02:00
|
|
|
|
return new NetworkOptionsConfiguration(groupId, logger.CloneFor(nameof(NetworkOptionsConfiguration)));
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-26 10:13:11 +02:00
|
|
|
|
public IFeatureConfiguration CreatePowerOptionsConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-06-26 10:13:11 +02:00
|
|
|
|
return new PowerOptionsConfiguration(groupId, logger.CloneFor(nameof(PowerOptionsConfiguration)));
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-26 10:13:11 +02:00
|
|
|
|
public IFeatureConfiguration CreateRemoteConnectionConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-06-26 10:13:11 +02:00
|
|
|
|
return new RemoteConnectionConfiguration(groupId, logger.CloneFor(nameof(RemoteConnectionConfiguration)));
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 08:59:27 +02:00
|
|
|
|
public IFeatureConfiguration CreateSignoutConfiguration(Guid groupId, string sid, string userName)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-07-03 08:59:27 +02:00
|
|
|
|
return new SignoutConfiguration(groupId, logger.CloneFor(nameof(SignoutConfiguration)), sid, userName);
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 08:59:27 +02:00
|
|
|
|
public IFeatureConfiguration CreateSwitchUserConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-07-03 08:59:27 +02:00
|
|
|
|
return new SwitchUserConfiguration(groupId, logger.CloneFor(nameof(SwitchUserConfiguration)));
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 08:59:27 +02:00
|
|
|
|
public IFeatureConfiguration CreateTaskManagerConfiguration(Guid groupId, string sid, string userName)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-07-03 08:59:27 +02:00
|
|
|
|
return new TaskManagerConfiguration(groupId, logger.CloneFor(nameof(TaskManagerConfiguration)), sid, userName);
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-07-03 08:59:27 +02:00
|
|
|
|
public IFeatureConfiguration CreateVmwareOverlayConfiguration(Guid groupId, string sid, string userName)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-07-03 08:59:27 +02:00
|
|
|
|
return new VmwareOverlayConfiguration(groupId, logger.CloneFor(nameof(VmwareOverlayConfiguration)), sid, userName);
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-26 10:13:11 +02:00
|
|
|
|
public IFeatureConfiguration CreateWindowsUpdateConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-06-26 10:13:11 +02:00
|
|
|
|
return new WindowsUpdateConfiguration(groupId, logger.CloneFor(nameof(WindowsUpdateConfiguration)));
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|