@@ -38,57 +38,57 @@ |
||
| 38 | 38 | |
| 39 | 39 | $application = new Application(); |
| 40 | 40 | $application->registerRoutes($this, [ |
| 41 | - 'resources' => [ |
|
| 42 | - 'AuthSettings' => ['url' => '/settings/personal/authtokens'], |
|
| 43 | - ], |
|
| 44 | - 'routes' => [ |
|
| 45 | - ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'], |
|
| 46 | - ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'], |
|
| 47 | - ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'], |
|
| 48 | - ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'], |
|
| 41 | + 'resources' => [ |
|
| 42 | + 'AuthSettings' => ['url' => '/settings/personal/authtokens'], |
|
| 43 | + ], |
|
| 44 | + 'routes' => [ |
|
| 45 | + ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'], |
|
| 46 | + ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'], |
|
| 47 | + ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'], |
|
| 48 | + ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'], |
|
| 49 | 49 | |
| 50 | - ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'], |
|
| 51 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'], |
|
| 52 | - ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'], |
|
| 53 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET'], |
|
| 54 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST'], |
|
| 55 | - ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST'], |
|
| 56 | - ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET'], |
|
| 57 | - ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST'], |
|
| 58 | - ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET'], |
|
| 59 | - ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET'], |
|
| 60 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => '']], |
|
| 61 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => '']], |
|
| 50 | + ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'], |
|
| 51 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'], |
|
| 52 | + ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'], |
|
| 53 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET'], |
|
| 54 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST'], |
|
| 55 | + ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST'], |
|
| 56 | + ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET'], |
|
| 57 | + ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST'], |
|
| 58 | + ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET'], |
|
| 59 | + ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET'], |
|
| 60 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => '']], |
|
| 61 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => '']], |
|
| 62 | 62 | |
| 63 | - ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'], |
|
| 64 | - ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'], |
|
| 65 | - ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'], |
|
| 66 | - ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET'], |
|
| 67 | - ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET'], |
|
| 68 | - ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET'], |
|
| 69 | - ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'], |
|
| 70 | - ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'], |
|
| 71 | - ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'], |
|
| 72 | - ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'], |
|
| 73 | - ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'], |
|
| 74 | - ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'], |
|
| 75 | - ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'], |
|
| 76 | - ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
| 77 | - ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'], |
|
| 78 | - ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
| 79 | - ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info']], |
|
| 80 | - ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']], |
|
| 81 | - ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'], |
|
| 82 | - ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'], |
|
| 83 | - ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'], |
|
| 84 | - ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET'], |
|
| 85 | - ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT'], |
|
| 86 | - ] |
|
| 63 | + ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'], |
|
| 64 | + ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'], |
|
| 65 | + ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'], |
|
| 66 | + ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET'], |
|
| 67 | + ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET'], |
|
| 68 | + ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET'], |
|
| 69 | + ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'], |
|
| 70 | + ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'], |
|
| 71 | + ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'], |
|
| 72 | + ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'], |
|
| 73 | + ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'], |
|
| 74 | + ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'], |
|
| 75 | + ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'], |
|
| 76 | + ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
| 77 | + ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'], |
|
| 78 | + ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
| 79 | + ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info']], |
|
| 80 | + ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']], |
|
| 81 | + ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'], |
|
| 82 | + ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'], |
|
| 83 | + ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'], |
|
| 84 | + ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET'], |
|
| 85 | + ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT'], |
|
| 86 | + ] |
|
| 87 | 87 | ]); |
| 88 | 88 | |
| 89 | 89 | /** @var $this \OCP\Route\IRouter */ |
| 90 | 90 | |
| 91 | 91 | // Settings pages |
| 92 | 92 | $this->create('settings_help', '/settings/help') |
| 93 | - ->actionInclude('settings/help.php'); |
|
| 93 | + ->actionInclude('settings/help.php'); |
|
| 94 | 94 | |
@@ -29,14 +29,14 @@ |
||
| 29 | 29 | ?> |
| 30 | 30 | |
| 31 | 31 | <div id="two-factor-auth" class="section"> |
| 32 | - <h2><?php p($l->t('Two-Factor Authentication'));?></h2> |
|
| 32 | + <h2><?php p($l->t('Two-Factor Authentication')); ?></h2> |
|
| 33 | 33 | <div id="two-factor-auth-settings"></div> |
| 34 | 34 | </div> |
| 35 | 35 | |
| 36 | 36 | <div class="section" id='encryptionAPI'> |
| 37 | 37 | <h2><?php p($l->t('Server-side encryption')); ?></h2> |
| 38 | 38 | <a target="_blank" rel="noreferrer noopener" class="icon-info" |
| 39 | - title="<?php p($l->t('Open documentation'));?>" |
|
| 39 | + title="<?php p($l->t('Open documentation')); ?>" |
|
| 40 | 40 | href="<?php p(link_to_docs('admin-encryption')); ?>"></a> |
| 41 | 41 | <p class="settings-hint"><?php p($l->t('Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed.')); ?></p> |
| 42 | 42 | <p id="enable"> |
@@ -35,29 +35,29 @@ |
||
| 35 | 35 | |
| 36 | 36 | class TwoFactorSettingsController extends Controller { |
| 37 | 37 | |
| 38 | - /** @var MandatoryTwoFactor */ |
|
| 39 | - private $mandatoryTwoFactor; |
|
| 40 | - |
|
| 41 | - public function __construct(string $appName, |
|
| 42 | - IRequest $request, |
|
| 43 | - MandatoryTwoFactor $mandatoryTwoFactor) { |
|
| 44 | - parent::__construct($appName, $request); |
|
| 45 | - |
|
| 46 | - $this->mandatoryTwoFactor = $mandatoryTwoFactor; |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - public function index(): Response { |
|
| 50 | - return new JSONResponse([ |
|
| 51 | - 'enabled' => $this->mandatoryTwoFactor->isEnforced(), |
|
| 52 | - ]); |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - public function update(bool $enabled): Response { |
|
| 56 | - $this->mandatoryTwoFactor->setEnforced($enabled); |
|
| 57 | - |
|
| 58 | - return new JSONResponse([ |
|
| 59 | - 'enabled' => $enabled |
|
| 60 | - ]); |
|
| 61 | - } |
|
| 38 | + /** @var MandatoryTwoFactor */ |
|
| 39 | + private $mandatoryTwoFactor; |
|
| 40 | + |
|
| 41 | + public function __construct(string $appName, |
|
| 42 | + IRequest $request, |
|
| 43 | + MandatoryTwoFactor $mandatoryTwoFactor) { |
|
| 44 | + parent::__construct($appName, $request); |
|
| 45 | + |
|
| 46 | + $this->mandatoryTwoFactor = $mandatoryTwoFactor; |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + public function index(): Response { |
|
| 50 | + return new JSONResponse([ |
|
| 51 | + 'enabled' => $this->mandatoryTwoFactor->isEnforced(), |
|
| 52 | + ]); |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + public function update(bool $enabled): Response { |
|
| 56 | + $this->mandatoryTwoFactor->setEnforced($enabled); |
|
| 57 | + |
|
| 58 | + return new JSONResponse([ |
|
| 59 | + 'enabled' => $enabled |
|
| 60 | + ]); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | \ No newline at end of file |