@@ -34,76 +34,76 @@ |
||
| 34 | 34 | |
| 35 | 35 | class Security implements ISettings { |
| 36 | 36 | |
| 37 | - /** @var IManager */ |
|
| 38 | - private $manager; |
|
| 37 | + /** @var IManager */ |
|
| 38 | + private $manager; |
|
| 39 | 39 | |
| 40 | - /** @var IUserManager */ |
|
| 41 | - private $userManager; |
|
| 40 | + /** @var IUserManager */ |
|
| 41 | + private $userManager; |
|
| 42 | 42 | |
| 43 | - /** @var MandatoryTwoFactor */ |
|
| 44 | - private $mandatoryTwoFactor; |
|
| 43 | + /** @var MandatoryTwoFactor */ |
|
| 44 | + private $mandatoryTwoFactor; |
|
| 45 | 45 | |
| 46 | - /** @var IInitialStateService */ |
|
| 47 | - private $initialState; |
|
| 46 | + /** @var IInitialStateService */ |
|
| 47 | + private $initialState; |
|
| 48 | 48 | |
| 49 | - public function __construct(IManager $manager, |
|
| 50 | - IUserManager $userManager, |
|
| 51 | - MandatoryTwoFactor $mandatoryTwoFactor, |
|
| 52 | - IInitialStateService $initialState) { |
|
| 53 | - $this->manager = $manager; |
|
| 54 | - $this->userManager = $userManager; |
|
| 55 | - $this->mandatoryTwoFactor = $mandatoryTwoFactor; |
|
| 56 | - $this->initialState = $initialState; |
|
| 57 | - } |
|
| 49 | + public function __construct(IManager $manager, |
|
| 50 | + IUserManager $userManager, |
|
| 51 | + MandatoryTwoFactor $mandatoryTwoFactor, |
|
| 52 | + IInitialStateService $initialState) { |
|
| 53 | + $this->manager = $manager; |
|
| 54 | + $this->userManager = $userManager; |
|
| 55 | + $this->mandatoryTwoFactor = $mandatoryTwoFactor; |
|
| 56 | + $this->initialState = $initialState; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * @return TemplateResponse |
|
| 61 | - */ |
|
| 62 | - public function getForm() { |
|
| 63 | - $encryptionModules = $this->manager->getEncryptionModules(); |
|
| 64 | - $defaultEncryptionModuleId = $this->manager->getDefaultEncryptionModuleId(); |
|
| 65 | - $encryptionModuleList = []; |
|
| 66 | - foreach ($encryptionModules as $module) { |
|
| 67 | - $encryptionModuleList[$module['id']]['displayName'] = $module['displayName']; |
|
| 68 | - $encryptionModuleList[$module['id']]['default'] = false; |
|
| 69 | - if ($module['id'] === $defaultEncryptionModuleId) { |
|
| 70 | - $encryptionModuleList[$module['id']]['default'] = true; |
|
| 71 | - } |
|
| 72 | - } |
|
| 59 | + /** |
|
| 60 | + * @return TemplateResponse |
|
| 61 | + */ |
|
| 62 | + public function getForm() { |
|
| 63 | + $encryptionModules = $this->manager->getEncryptionModules(); |
|
| 64 | + $defaultEncryptionModuleId = $this->manager->getDefaultEncryptionModuleId(); |
|
| 65 | + $encryptionModuleList = []; |
|
| 66 | + foreach ($encryptionModules as $module) { |
|
| 67 | + $encryptionModuleList[$module['id']]['displayName'] = $module['displayName']; |
|
| 68 | + $encryptionModuleList[$module['id']]['default'] = false; |
|
| 69 | + if ($module['id'] === $defaultEncryptionModuleId) { |
|
| 70 | + $encryptionModuleList[$module['id']]['default'] = true; |
|
| 71 | + } |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - $this->initialState->provideInitialState( |
|
| 75 | - 'settings', |
|
| 76 | - 'mandatory2FAState', |
|
| 77 | - $this->mandatoryTwoFactor->getState() |
|
| 78 | - ); |
|
| 74 | + $this->initialState->provideInitialState( |
|
| 75 | + 'settings', |
|
| 76 | + 'mandatory2FAState', |
|
| 77 | + $this->mandatoryTwoFactor->getState() |
|
| 78 | + ); |
|
| 79 | 79 | |
| 80 | - $parameters = [ |
|
| 81 | - // Encryption API |
|
| 82 | - 'encryptionEnabled' => $this->manager->isEnabled(), |
|
| 83 | - 'encryptionReady' => $this->manager->isReady(), |
|
| 84 | - 'externalBackendsEnabled' => count($this->userManager->getBackends()) > 1, |
|
| 85 | - // Modules |
|
| 86 | - 'encryptionModules' => $encryptionModuleList, |
|
| 87 | - ]; |
|
| 80 | + $parameters = [ |
|
| 81 | + // Encryption API |
|
| 82 | + 'encryptionEnabled' => $this->manager->isEnabled(), |
|
| 83 | + 'encryptionReady' => $this->manager->isReady(), |
|
| 84 | + 'externalBackendsEnabled' => count($this->userManager->getBackends()) > 1, |
|
| 85 | + // Modules |
|
| 86 | + 'encryptionModules' => $encryptionModuleList, |
|
| 87 | + ]; |
|
| 88 | 88 | |
| 89 | - return new TemplateResponse('settings', 'settings/admin/security', $parameters, ''); |
|
| 90 | - } |
|
| 89 | + return new TemplateResponse('settings', 'settings/admin/security', $parameters, ''); |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * @return string the section ID, e.g. 'sharing' |
|
| 94 | - */ |
|
| 95 | - public function getSection() { |
|
| 96 | - return 'security'; |
|
| 97 | - } |
|
| 92 | + /** |
|
| 93 | + * @return string the section ID, e.g. 'sharing' |
|
| 94 | + */ |
|
| 95 | + public function getSection() { |
|
| 96 | + return 'security'; |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - /** |
|
| 100 | - * @return int whether the form should be rather on the top or bottom of |
|
| 101 | - * the admin section. The forms are arranged in ascending order of the |
|
| 102 | - * priority values. It is required to return a value between 0 and 100. |
|
| 103 | - * |
|
| 104 | - * E.g.: 70 |
|
| 105 | - */ |
|
| 106 | - public function getPriority() { |
|
| 107 | - return 10; |
|
| 108 | - } |
|
| 99 | + /** |
|
| 100 | + * @return int whether the form should be rather on the top or bottom of |
|
| 101 | + * the admin section. The forms are arranged in ascending order of the |
|
| 102 | + * priority values. It is required to return a value between 0 and 100. |
|
| 103 | + * |
|
| 104 | + * E.g.: 70 |
|
| 105 | + */ |
|
| 106 | + public function getPriority() { |
|
| 107 | + return 10; |
|
| 108 | + } |
|
| 109 | 109 | } |