2019-06-21 15:05:31 +02:00
|
|
|
|
/*
|
2024-03-05 18:37:42 +01:00
|
|
|
|
* Copyright (c) 2024 ETH Zürich, IT Services
|
2019-06-21 15:05:31 +02:00
|
|
|
|
*
|
|
|
|
|
* 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-07-19 10:07:45 +02:00
|
|
|
|
using System.Collections.Generic;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.Lockdown.Contracts;
|
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;
|
2022-07-26 15:10:48 +02:00
|
|
|
|
using SafeExamBrowser.Logging.Contracts;
|
2019-06-21 15:05:31 +02:00
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.Lockdown
|
|
|
|
|
{
|
|
|
|
|
public class FeatureConfigurationFactory : IFeatureConfigurationFactory
|
|
|
|
|
{
|
2022-07-26 15:10:48 +02:00
|
|
|
|
private readonly IModuleLogger logger;
|
2019-06-21 15:05:31 +02:00
|
|
|
|
|
|
|
|
|
public FeatureConfigurationFactory(IModuleLogger logger)
|
|
|
|
|
{
|
|
|
|
|
this.logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-19 10:07:45 +02:00
|
|
|
|
public IList<IFeatureConfiguration> CreateAll(Guid groupId, string sid, string userName)
|
|
|
|
|
{
|
|
|
|
|
return new List<IFeatureConfiguration>
|
|
|
|
|
{
|
|
|
|
|
CreateChangePasswordConfiguration(groupId, sid, userName),
|
|
|
|
|
CreateChromeNotificationConfiguration(groupId, sid, userName),
|
|
|
|
|
CreateEaseOfAccessConfiguration(groupId),
|
2022-07-26 15:10:48 +02:00
|
|
|
|
CreateFindPrinterConfiguration(groupId, sid, userName),
|
2019-07-19 10:07:45 +02:00
|
|
|
|
CreateLockWorkstationConfiguration(groupId, sid, userName),
|
2019-08-13 08:29:48 +02:00
|
|
|
|
CreateMachinePowerOptionsConfiguration(groupId),
|
2019-07-19 10:07:45 +02:00
|
|
|
|
CreateNetworkOptionsConfiguration(groupId),
|
|
|
|
|
CreateRemoteConnectionConfiguration(groupId),
|
|
|
|
|
CreateSignoutConfiguration(groupId, sid, userName),
|
|
|
|
|
CreateSwitchUserConfiguration(groupId),
|
|
|
|
|
CreateTaskManagerConfiguration(groupId, sid, userName),
|
2019-08-13 08:29:48 +02:00
|
|
|
|
CreateUserPowerOptionsConfiguration(groupId, sid, userName),
|
2019-07-19 10:07:45 +02:00
|
|
|
|
CreateVmwareOverlayConfiguration(groupId, sid, userName),
|
|
|
|
|
CreateWindowsUpdateConfiguration(groupId)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2022-07-26 15:10:48 +02:00
|
|
|
|
public IFeatureConfiguration CreateFindPrinterConfiguration(Guid groupId, string sid, string userName)
|
|
|
|
|
{
|
|
|
|
|
return new FindPrinterConfiguration(groupId, logger.CloneFor(nameof(FindPrinterConfiguration)), sid, userName);
|
|
|
|
|
}
|
|
|
|
|
|
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-08-13 08:29:48 +02:00
|
|
|
|
public IFeatureConfiguration CreateMachinePowerOptionsConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-08-13 08:29:48 +02:00
|
|
|
|
return new MachinePowerOptionsConfiguration(groupId, logger.CloneFor(nameof(MachinePowerOptionsConfiguration)));
|
2019-06-21 15:05:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-13 08:29:48 +02:00
|
|
|
|
public IFeatureConfiguration CreateNetworkOptionsConfiguration(Guid groupId)
|
2019-06-21 15:05:31 +02:00
|
|
|
|
{
|
2019-08-13 08:29:48 +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 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-08-13 08:29:48 +02:00
|
|
|
|
public IFeatureConfiguration CreateUserPowerOptionsConfiguration(Guid groupId, string sid, string userName)
|
|
|
|
|
{
|
|
|
|
|
return new UserPowerOptionsConfiguration(groupId, logger.CloneFor(nameof(UserPowerOptionsConfiguration)), sid, userName);
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|