@@ -37,124 +37,124 @@ |
||
37 | 37 | use OCP\Settings\ISettings; |
38 | 38 | |
39 | 39 | class Server implements ISettings { |
40 | - /** @var IDBConnection|Connection */ |
|
41 | - private $db; |
|
42 | - /** @var IRequest */ |
|
43 | - private $request; |
|
44 | - /** @var IConfig */ |
|
45 | - private $config; |
|
46 | - /** @var ILockingProvider */ |
|
47 | - private $lockingProvider; |
|
48 | - /** @var IL10N */ |
|
49 | - private $l; |
|
40 | + /** @var IDBConnection|Connection */ |
|
41 | + private $db; |
|
42 | + /** @var IRequest */ |
|
43 | + private $request; |
|
44 | + /** @var IConfig */ |
|
45 | + private $config; |
|
46 | + /** @var ILockingProvider */ |
|
47 | + private $lockingProvider; |
|
48 | + /** @var IL10N */ |
|
49 | + private $l; |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param IDBConnection $db |
|
53 | - * @param IRequest $request |
|
54 | - * @param IConfig $config |
|
55 | - * @param ILockingProvider $lockingProvider |
|
56 | - * @param IL10N $l |
|
57 | - */ |
|
58 | - public function __construct(IDBConnection $db, |
|
59 | - IRequest $request, |
|
60 | - IConfig $config, |
|
61 | - ILockingProvider $lockingProvider, |
|
62 | - IL10N $l) { |
|
63 | - $this->db = $db; |
|
64 | - $this->request = $request; |
|
65 | - $this->config = $config; |
|
66 | - $this->lockingProvider = $lockingProvider; |
|
67 | - $this->l = $l; |
|
68 | - } |
|
51 | + /** |
|
52 | + * @param IDBConnection $db |
|
53 | + * @param IRequest $request |
|
54 | + * @param IConfig $config |
|
55 | + * @param ILockingProvider $lockingProvider |
|
56 | + * @param IL10N $l |
|
57 | + */ |
|
58 | + public function __construct(IDBConnection $db, |
|
59 | + IRequest $request, |
|
60 | + IConfig $config, |
|
61 | + ILockingProvider $lockingProvider, |
|
62 | + IL10N $l) { |
|
63 | + $this->db = $db; |
|
64 | + $this->request = $request; |
|
65 | + $this->config = $config; |
|
66 | + $this->lockingProvider = $lockingProvider; |
|
67 | + $this->l = $l; |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * @return TemplateResponse |
|
72 | - */ |
|
73 | - public function getForm() { |
|
74 | - try { |
|
75 | - if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) { |
|
76 | - $invalidTransactionIsolationLevel = false; |
|
77 | - } else { |
|
78 | - $invalidTransactionIsolationLevel = $this->db->getTransactionIsolation() !== Connection::TRANSACTION_READ_COMMITTED; |
|
79 | - } |
|
80 | - } catch (DBALException $e) { |
|
81 | - // ignore |
|
82 | - $invalidTransactionIsolationLevel = false; |
|
83 | - } |
|
70 | + /** |
|
71 | + * @return TemplateResponse |
|
72 | + */ |
|
73 | + public function getForm() { |
|
74 | + try { |
|
75 | + if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) { |
|
76 | + $invalidTransactionIsolationLevel = false; |
|
77 | + } else { |
|
78 | + $invalidTransactionIsolationLevel = $this->db->getTransactionIsolation() !== Connection::TRANSACTION_READ_COMMITTED; |
|
79 | + } |
|
80 | + } catch (DBALException $e) { |
|
81 | + // ignore |
|
82 | + $invalidTransactionIsolationLevel = false; |
|
83 | + } |
|
84 | 84 | |
85 | - $envPath = getenv('PATH'); |
|
85 | + $envPath = getenv('PATH'); |
|
86 | 86 | |
87 | - // warn if outdated version of a memcache module is used |
|
88 | - $caches = [ |
|
89 | - 'apcu' => ['name' => $this->l->t('APCu'), 'version' => '4.0.6'], |
|
90 | - 'redis' => ['name' => $this->l->t('Redis'), 'version' => '2.2.5'], |
|
91 | - ]; |
|
92 | - $outdatedCaches = []; |
|
93 | - foreach ($caches as $php_module => $data) { |
|
94 | - $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<'); |
|
95 | - if ($isOutdated) { |
|
96 | - $outdatedCaches[$php_module] = $data; |
|
97 | - } |
|
98 | - } |
|
87 | + // warn if outdated version of a memcache module is used |
|
88 | + $caches = [ |
|
89 | + 'apcu' => ['name' => $this->l->t('APCu'), 'version' => '4.0.6'], |
|
90 | + 'redis' => ['name' => $this->l->t('Redis'), 'version' => '2.2.5'], |
|
91 | + ]; |
|
92 | + $outdatedCaches = []; |
|
93 | + foreach ($caches as $php_module => $data) { |
|
94 | + $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<'); |
|
95 | + if ($isOutdated) { |
|
96 | + $outdatedCaches[$php_module] = $data; |
|
97 | + } |
|
98 | + } |
|
99 | 99 | |
100 | - if ($this->lockingProvider instanceof NoopLockingProvider) { |
|
101 | - $fileLockingType = 'none'; |
|
102 | - } else if ($this->lockingProvider instanceof DBLockingProvider) { |
|
103 | - $fileLockingType = 'db'; |
|
104 | - } else { |
|
105 | - $fileLockingType = 'cache'; |
|
106 | - } |
|
100 | + if ($this->lockingProvider instanceof NoopLockingProvider) { |
|
101 | + $fileLockingType = 'none'; |
|
102 | + } else if ($this->lockingProvider instanceof DBLockingProvider) { |
|
103 | + $fileLockingType = 'db'; |
|
104 | + } else { |
|
105 | + $fileLockingType = 'cache'; |
|
106 | + } |
|
107 | 107 | |
108 | - $suggestedOverwriteCliUrl = ''; |
|
109 | - if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
|
110 | - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
111 | - if (!$this->config->getSystemValue('config_is_read_only', false)) { |
|
112 | - // Set the overwrite URL when it was not set yet. |
|
113 | - $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
|
114 | - $suggestedOverwriteCliUrl = ''; |
|
115 | - } |
|
116 | - } |
|
108 | + $suggestedOverwriteCliUrl = ''; |
|
109 | + if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
|
110 | + $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
111 | + if (!$this->config->getSystemValue('config_is_read_only', false)) { |
|
112 | + // Set the overwrite URL when it was not set yet. |
|
113 | + $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
|
114 | + $suggestedOverwriteCliUrl = ''; |
|
115 | + } |
|
116 | + } |
|
117 | 117 | |
118 | - $parameters = [ |
|
119 | - // Diagnosis |
|
120 | - 'readOnlyConfigEnabled' => \OC_Helper::isReadOnlyConfigEnabled(), |
|
121 | - 'isLocaleWorking' => \OC_Util::isSetLocaleWorking(), |
|
122 | - 'isAnnotationsWorking' => \OC_Util::isAnnotationsWorking(), |
|
123 | - 'checkForWorkingWellKnownSetup' => $this->config->getSystemValue('check_for_working_wellknown_setup', true), |
|
124 | - 'has_fileinfo' => \OC_Util::fileInfoLoaded(), |
|
125 | - 'invalidTransactionIsolationLevel' => $invalidTransactionIsolationLevel, |
|
126 | - 'getenvServerNotWorking' => empty($envPath), |
|
127 | - 'OutdatedCacheWarning' => $outdatedCaches, |
|
128 | - 'fileLockingType' => $fileLockingType, |
|
129 | - 'suggestedOverwriteCliUrl' => $suggestedOverwriteCliUrl, |
|
118 | + $parameters = [ |
|
119 | + // Diagnosis |
|
120 | + 'readOnlyConfigEnabled' => \OC_Helper::isReadOnlyConfigEnabled(), |
|
121 | + 'isLocaleWorking' => \OC_Util::isSetLocaleWorking(), |
|
122 | + 'isAnnotationsWorking' => \OC_Util::isAnnotationsWorking(), |
|
123 | + 'checkForWorkingWellKnownSetup' => $this->config->getSystemValue('check_for_working_wellknown_setup', true), |
|
124 | + 'has_fileinfo' => \OC_Util::fileInfoLoaded(), |
|
125 | + 'invalidTransactionIsolationLevel' => $invalidTransactionIsolationLevel, |
|
126 | + 'getenvServerNotWorking' => empty($envPath), |
|
127 | + 'OutdatedCacheWarning' => $outdatedCaches, |
|
128 | + 'fileLockingType' => $fileLockingType, |
|
129 | + 'suggestedOverwriteCliUrl' => $suggestedOverwriteCliUrl, |
|
130 | 130 | |
131 | - // Background jobs |
|
132 | - 'backgroundjobs_mode' => $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax'), |
|
133 | - 'cron_log' => $this->config->getSystemValue('cron_log', true), |
|
134 | - 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
|
135 | - 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
|
136 | - 'cli_based_cron_possible' => function_exists('posix_getpwuid'), |
|
137 | - 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', |
|
138 | - ]; |
|
131 | + // Background jobs |
|
132 | + 'backgroundjobs_mode' => $this->config->getAppValue('core', 'backgroundjobs_mode', 'ajax'), |
|
133 | + 'cron_log' => $this->config->getSystemValue('cron_log', true), |
|
134 | + 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
|
135 | + 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
|
136 | + 'cli_based_cron_possible' => function_exists('posix_getpwuid'), |
|
137 | + 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', |
|
138 | + ]; |
|
139 | 139 | |
140 | - return new TemplateResponse('settings', 'settings/admin/server', $parameters, ''); |
|
141 | - } |
|
140 | + return new TemplateResponse('settings', 'settings/admin/server', $parameters, ''); |
|
141 | + } |
|
142 | 142 | |
143 | - /** |
|
144 | - * @return string the section ID, e.g. 'sharing' |
|
145 | - */ |
|
146 | - public function getSection() { |
|
147 | - return 'server'; |
|
148 | - } |
|
143 | + /** |
|
144 | + * @return string the section ID, e.g. 'sharing' |
|
145 | + */ |
|
146 | + public function getSection() { |
|
147 | + return 'server'; |
|
148 | + } |
|
149 | 149 | |
150 | - /** |
|
151 | - * @return int whether the form should be rather on the top or bottom of |
|
152 | - * the admin section. The forms are arranged in ascending order of the |
|
153 | - * priority values. It is required to return a value between 0 and 100. |
|
154 | - * |
|
155 | - * E.g.: 70 |
|
156 | - */ |
|
157 | - public function getPriority() { |
|
158 | - return 0; |
|
159 | - } |
|
150 | + /** |
|
151 | + * @return int whether the form should be rather on the top or bottom of |
|
152 | + * the admin section. The forms are arranged in ascending order of the |
|
153 | + * priority values. It is required to return a value between 0 and 100. |
|
154 | + * |
|
155 | + * E.g.: 70 |
|
156 | + */ |
|
157 | + public function getPriority() { |
|
158 | + return 0; |
|
159 | + } |
|
160 | 160 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $suggestedOverwriteCliUrl = ''; |
109 | 109 | if ($this->config->getSystemValue('overwrite.cli.url', '') === '') { |
110 | - $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT; |
|
110 | + $suggestedOverwriteCliUrl = $this->request->getServerProtocol().'://'.$this->request->getInsecureServerHost().\OC::$WEBROOT; |
|
111 | 111 | if (!$this->config->getSystemValue('config_is_read_only', false)) { |
112 | 112 | // Set the overwrite URL when it was not set yet. |
113 | 113 | $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'lastcron' => $this->config->getAppValue('core', 'lastcron', false), |
135 | 135 | 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'), |
136 | 136 | 'cli_based_cron_possible' => function_exists('posix_getpwuid'), |
137 | - 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', |
|
137 | + 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir.'config.php'))['name'] : '', |
|
138 | 138 | ]; |
139 | 139 | |
140 | 140 | return new TemplateResponse('settings', 'settings/admin/server', $parameters, ''); |
@@ -28,57 +28,57 @@ |
||
28 | 28 | use OCP\Settings\ISettings; |
29 | 29 | |
30 | 30 | class Additional implements ISettings { |
31 | - /** @var IConfig */ |
|
32 | - private $config; |
|
31 | + /** @var IConfig */ |
|
32 | + private $config; |
|
33 | 33 | |
34 | - /** |
|
35 | - * @param IConfig $config |
|
36 | - */ |
|
37 | - public function __construct(IConfig $config) { |
|
38 | - $this->config = $config; |
|
39 | - } |
|
34 | + /** |
|
35 | + * @param IConfig $config |
|
36 | + */ |
|
37 | + public function __construct(IConfig $config) { |
|
38 | + $this->config = $config; |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @return TemplateResponse |
|
43 | - */ |
|
44 | - public function getForm() { |
|
45 | - $parameters = [ |
|
46 | ||
47 | - 'sendmail_is_available' => (bool) \OC_Helper::findBinaryPath('sendmail'), |
|
48 | - 'mail_domain' => $this->config->getSystemValue('mail_domain', ''), |
|
49 | - 'mail_from_address' => $this->config->getSystemValue('mail_from_address', ''), |
|
50 | - 'mail_smtpmode' => $this->config->getSystemValue('mail_smtpmode', ''), |
|
51 | - 'mail_smtpsecure' => $this->config->getSystemValue('mail_smtpsecure', ''), |
|
52 | - 'mail_smtphost' => $this->config->getSystemValue('mail_smtphost', ''), |
|
53 | - 'mail_smtpport' => $this->config->getSystemValue('mail_smtpport', ''), |
|
54 | - 'mail_smtpauthtype' => $this->config->getSystemValue('mail_smtpauthtype', ''), |
|
55 | - 'mail_smtpauth' => $this->config->getSystemValue('mail_smtpauth', false), |
|
56 | - 'mail_smtpname' => $this->config->getSystemValue('mail_smtpname', ''), |
|
57 | - 'mail_smtppassword' => $this->config->getSystemValue('mail_smtppassword', ''), |
|
58 | - ]; |
|
41 | + /** |
|
42 | + * @return TemplateResponse |
|
43 | + */ |
|
44 | + public function getForm() { |
|
45 | + $parameters = [ |
|
46 | ||
47 | + 'sendmail_is_available' => (bool) \OC_Helper::findBinaryPath('sendmail'), |
|
48 | + 'mail_domain' => $this->config->getSystemValue('mail_domain', ''), |
|
49 | + 'mail_from_address' => $this->config->getSystemValue('mail_from_address', ''), |
|
50 | + 'mail_smtpmode' => $this->config->getSystemValue('mail_smtpmode', ''), |
|
51 | + 'mail_smtpsecure' => $this->config->getSystemValue('mail_smtpsecure', ''), |
|
52 | + 'mail_smtphost' => $this->config->getSystemValue('mail_smtphost', ''), |
|
53 | + 'mail_smtpport' => $this->config->getSystemValue('mail_smtpport', ''), |
|
54 | + 'mail_smtpauthtype' => $this->config->getSystemValue('mail_smtpauthtype', ''), |
|
55 | + 'mail_smtpauth' => $this->config->getSystemValue('mail_smtpauth', false), |
|
56 | + 'mail_smtpname' => $this->config->getSystemValue('mail_smtpname', ''), |
|
57 | + 'mail_smtppassword' => $this->config->getSystemValue('mail_smtppassword', ''), |
|
58 | + ]; |
|
59 | 59 | |
60 | - if ($parameters['mail_smtppassword'] !== '') { |
|
61 | - $parameters['mail_smtppassword'] = '********'; |
|
62 | - } |
|
60 | + if ($parameters['mail_smtppassword'] !== '') { |
|
61 | + $parameters['mail_smtppassword'] = '********'; |
|
62 | + } |
|
63 | 63 | |
64 | - return new TemplateResponse('settings', 'settings/admin/additional-mail', $parameters, ''); |
|
65 | - } |
|
64 | + return new TemplateResponse('settings', 'settings/admin/additional-mail', $parameters, ''); |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * @return string the section ID, e.g. 'sharing' |
|
69 | - */ |
|
70 | - public function getSection() { |
|
71 | - return 'additional'; |
|
72 | - } |
|
67 | + /** |
|
68 | + * @return string the section ID, e.g. 'sharing' |
|
69 | + */ |
|
70 | + public function getSection() { |
|
71 | + return 'additional'; |
|
72 | + } |
|
73 | 73 | |
74 | - /** |
|
75 | - * @return int whether the form should be rather on the top or bottom of |
|
76 | - * the admin section. The forms are arranged in ascending order of the |
|
77 | - * priority values. It is required to return a value between 0 and 100. |
|
78 | - * |
|
79 | - * E.g.: 70 |
|
80 | - */ |
|
81 | - public function getPriority() { |
|
82 | - return 0; |
|
83 | - } |
|
74 | + /** |
|
75 | + * @return int whether the form should be rather on the top or bottom of |
|
76 | + * the admin section. The forms are arranged in ascending order of the |
|
77 | + * priority values. It is required to return a value between 0 and 100. |
|
78 | + * |
|
79 | + * E.g.: 70 |
|
80 | + */ |
|
81 | + public function getPriority() { |
|
82 | + return 0; |
|
83 | + } |
|
84 | 84 | } |
@@ -28,44 +28,44 @@ |
||
28 | 28 | use OCP\Settings\ISettings; |
29 | 29 | |
30 | 30 | class TipsTricks implements ISettings { |
31 | - /** @var IConfig */ |
|
32 | - private $config; |
|
31 | + /** @var IConfig */ |
|
32 | + private $config; |
|
33 | 33 | |
34 | - /** |
|
35 | - * @param IConfig $config |
|
36 | - */ |
|
37 | - public function __construct(IConfig $config) { |
|
38 | - $this->config = $config; |
|
39 | - } |
|
34 | + /** |
|
35 | + * @param IConfig $config |
|
36 | + */ |
|
37 | + public function __construct(IConfig $config) { |
|
38 | + $this->config = $config; |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @return TemplateResponse |
|
43 | - */ |
|
44 | - public function getForm() { |
|
45 | - $databaseOverload = (strpos($this->config->getSystemValue('dbtype'), 'sqlite') !== false); |
|
41 | + /** |
|
42 | + * @return TemplateResponse |
|
43 | + */ |
|
44 | + public function getForm() { |
|
45 | + $databaseOverload = (strpos($this->config->getSystemValue('dbtype'), 'sqlite') !== false); |
|
46 | 46 | |
47 | - $parameters = [ |
|
48 | - 'databaseOverload' => $databaseOverload, |
|
49 | - ]; |
|
47 | + $parameters = [ |
|
48 | + 'databaseOverload' => $databaseOverload, |
|
49 | + ]; |
|
50 | 50 | |
51 | - return new TemplateResponse('settings', 'settings/admin/tipstricks', $parameters, ''); |
|
52 | - } |
|
51 | + return new TemplateResponse('settings', 'settings/admin/tipstricks', $parameters, ''); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @return string the section ID, e.g. 'sharing' |
|
56 | - */ |
|
57 | - public function getSection() { |
|
58 | - return 'tips-tricks'; |
|
59 | - } |
|
54 | + /** |
|
55 | + * @return string the section ID, e.g. 'sharing' |
|
56 | + */ |
|
57 | + public function getSection() { |
|
58 | + return 'tips-tricks'; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * @return int whether the form should be rather on the top or bottom of |
|
63 | - * the admin section. The forms are arranged in ascending order of the |
|
64 | - * priority values. It is required to return a value between 0 and 100. |
|
65 | - * |
|
66 | - * E.g.: 70 |
|
67 | - */ |
|
68 | - public function getPriority() { |
|
69 | - return 0; |
|
70 | - } |
|
61 | + /** |
|
62 | + * @return int whether the form should be rather on the top or bottom of |
|
63 | + * the admin section. The forms are arranged in ascending order of the |
|
64 | + * priority values. It is required to return a value between 0 and 100. |
|
65 | + * |
|
66 | + * E.g.: 70 |
|
67 | + */ |
|
68 | + public function getPriority() { |
|
69 | + return 0; |
|
70 | + } |
|
71 | 71 | } |
@@ -26,28 +26,28 @@ |
||
26 | 26 | use OCP\Settings\ISettings; |
27 | 27 | |
28 | 28 | class ServerDevNotice implements ISettings { |
29 | - /** |
|
30 | - * @return TemplateResponse |
|
31 | - */ |
|
32 | - public function getForm() { |
|
33 | - return new TemplateResponse('settings', 'settings/admin/server.development.notice'); |
|
34 | - } |
|
29 | + /** |
|
30 | + * @return TemplateResponse |
|
31 | + */ |
|
32 | + public function getForm() { |
|
33 | + return new TemplateResponse('settings', 'settings/admin/server.development.notice'); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * @return string the section ID, e.g. 'sharing' |
|
38 | - */ |
|
39 | - public function getSection() { |
|
40 | - return 'server'; |
|
41 | - } |
|
36 | + /** |
|
37 | + * @return string the section ID, e.g. 'sharing' |
|
38 | + */ |
|
39 | + public function getSection() { |
|
40 | + return 'server'; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * @return int whether the form should be rather on the top or bottom of |
|
45 | - * the admin section. The forms are arranged in ascending order of the |
|
46 | - * priority values. It is required to return a value between 0 and 100. |
|
47 | - * |
|
48 | - * E.g.: 70 |
|
49 | - */ |
|
50 | - public function getPriority() { |
|
51 | - return 1000; |
|
52 | - } |
|
43 | + /** |
|
44 | + * @return int whether the form should be rather on the top or bottom of |
|
45 | + * the admin section. The forms are arranged in ascending order of the |
|
46 | + * priority values. It is required to return a value between 0 and 100. |
|
47 | + * |
|
48 | + * E.g.: 70 |
|
49 | + */ |
|
50 | + public function getPriority() { |
|
51 | + return 1000; |
|
52 | + } |
|
53 | 53 | } |
@@ -32,51 +32,51 @@ |
||
32 | 32 | |
33 | 33 | class Personal implements ISettings { |
34 | 34 | |
35 | - /** @var Application */ |
|
36 | - private $app; |
|
37 | - /** @var BackupCodesProvider */ |
|
38 | - private $provider; |
|
39 | - /** @var IUserSession */ |
|
40 | - private $userSession; |
|
35 | + /** @var Application */ |
|
36 | + private $app; |
|
37 | + /** @var BackupCodesProvider */ |
|
38 | + private $provider; |
|
39 | + /** @var IUserSession */ |
|
40 | + private $userSession; |
|
41 | 41 | |
42 | - public function __construct(Application $app, BackupCodesProvider $provider, IUserSession $userSession) { |
|
43 | - $this->app = $app; |
|
44 | - $this->provider = $provider; |
|
45 | - $this->userSession = $userSession; |
|
46 | - } |
|
42 | + public function __construct(Application $app, BackupCodesProvider $provider, IUserSession $userSession) { |
|
43 | + $this->app = $app; |
|
44 | + $this->provider = $provider; |
|
45 | + $this->userSession = $userSession; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
50 | - * @since 9.1 |
|
51 | - */ |
|
52 | - public function getForm() { |
|
53 | - $templateOwner = 'settings'; |
|
54 | - $templateName = 'settings/empty'; |
|
55 | - if ($this->provider->isActive($this->userSession->getUser())) { |
|
56 | - $templateOwner = $this->app->getContainer()->getAppName(); |
|
57 | - $templateName = 'personal'; |
|
58 | - } |
|
48 | + /** |
|
49 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
50 | + * @since 9.1 |
|
51 | + */ |
|
52 | + public function getForm() { |
|
53 | + $templateOwner = 'settings'; |
|
54 | + $templateName = 'settings/empty'; |
|
55 | + if ($this->provider->isActive($this->userSession->getUser())) { |
|
56 | + $templateOwner = $this->app->getContainer()->getAppName(); |
|
57 | + $templateName = 'personal'; |
|
58 | + } |
|
59 | 59 | |
60 | - return new TemplateResponse($templateOwner, $templateName, [], ''); |
|
61 | - } |
|
60 | + return new TemplateResponse($templateOwner, $templateName, [], ''); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @return string the section ID, e.g. 'sharing' |
|
65 | - * @since 9.1 |
|
66 | - */ |
|
67 | - public function getSection() { |
|
68 | - return 'security'; |
|
69 | - } |
|
63 | + /** |
|
64 | + * @return string the section ID, e.g. 'sharing' |
|
65 | + * @since 9.1 |
|
66 | + */ |
|
67 | + public function getSection() { |
|
68 | + return 'security'; |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return int whether the form should be rather on the top or bottom of |
|
73 | - * the admin section. The forms are arranged in ascending order of the |
|
74 | - * priority values. It is required to return a value between 0 and 100. |
|
75 | - * |
|
76 | - * E.g.: 70 |
|
77 | - * @since 9.1 |
|
78 | - */ |
|
79 | - public function getPriority() { |
|
80 | - return 40; |
|
81 | - } |
|
71 | + /** |
|
72 | + * @return int whether the form should be rather on the top or bottom of |
|
73 | + * the admin section. The forms are arranged in ascending order of the |
|
74 | + * priority values. It is required to return a value between 0 and 100. |
|
75 | + * |
|
76 | + * E.g.: 70 |
|
77 | + * @since 9.1 |
|
78 | + */ |
|
79 | + public function getPriority() { |
|
80 | + return 40; |
|
81 | + } |
|
82 | 82 | } |
@@ -33,63 +33,63 @@ |
||
33 | 33 | |
34 | 34 | class Personal implements ISettings { |
35 | 35 | |
36 | - /** @var IConfig */ |
|
37 | - private $config; |
|
38 | - /** @var Session */ |
|
39 | - private $session; |
|
40 | - /** @var Util */ |
|
41 | - private $util; |
|
42 | - /** @var IUserSession */ |
|
43 | - private $userSession; |
|
36 | + /** @var IConfig */ |
|
37 | + private $config; |
|
38 | + /** @var Session */ |
|
39 | + private $session; |
|
40 | + /** @var Util */ |
|
41 | + private $util; |
|
42 | + /** @var IUserSession */ |
|
43 | + private $userSession; |
|
44 | 44 | |
45 | - public function __construct(IConfig $config, Session $session, Util $util, IUserSession $userSession) { |
|
46 | - $this->config = $config; |
|
47 | - $this->session = $session; |
|
48 | - $this->util = $util; |
|
49 | - $this->userSession = $userSession; |
|
50 | - } |
|
45 | + public function __construct(IConfig $config, Session $session, Util $util, IUserSession $userSession) { |
|
46 | + $this->config = $config; |
|
47 | + $this->session = $session; |
|
48 | + $this->util = $util; |
|
49 | + $this->userSession = $userSession; |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
54 | - * @since 9.1 |
|
55 | - */ |
|
56 | - public function getForm() { |
|
57 | - $recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled'); |
|
58 | - $privateKeySet = $this->session->isPrivateKeySet(); |
|
52 | + /** |
|
53 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
54 | + * @since 9.1 |
|
55 | + */ |
|
56 | + public function getForm() { |
|
57 | + $recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled'); |
|
58 | + $privateKeySet = $this->session->isPrivateKeySet(); |
|
59 | 59 | |
60 | - if (!$recoveryAdminEnabled && $privateKeySet) { |
|
61 | - return new TemplateResponse('settings', 'settings/empty', [], ''); |
|
62 | - } |
|
60 | + if (!$recoveryAdminEnabled && $privateKeySet) { |
|
61 | + return new TemplateResponse('settings', 'settings/empty', [], ''); |
|
62 | + } |
|
63 | 63 | |
64 | - $userId = $this->userSession->getUser()->getUID(); |
|
65 | - $recoveryEnabledForUser = $this->util->isRecoveryEnabledForUser($userId); |
|
64 | + $userId = $this->userSession->getUser()->getUID(); |
|
65 | + $recoveryEnabledForUser = $this->util->isRecoveryEnabledForUser($userId); |
|
66 | 66 | |
67 | - $parameters = [ |
|
68 | - 'recoveryEnabled' => $recoveryAdminEnabled, |
|
69 | - 'recoveryEnabledForUser' => $recoveryEnabledForUser, |
|
70 | - 'privateKeySet' => $privateKeySet, |
|
71 | - 'initialized' => $this->session->getStatus(), |
|
72 | - ]; |
|
73 | - return new TemplateResponse('encryption', 'settings-personal', $parameters, ''); |
|
74 | - } |
|
67 | + $parameters = [ |
|
68 | + 'recoveryEnabled' => $recoveryAdminEnabled, |
|
69 | + 'recoveryEnabledForUser' => $recoveryEnabledForUser, |
|
70 | + 'privateKeySet' => $privateKeySet, |
|
71 | + 'initialized' => $this->session->getStatus(), |
|
72 | + ]; |
|
73 | + return new TemplateResponse('encryption', 'settings-personal', $parameters, ''); |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * @return string the section ID, e.g. 'sharing' |
|
78 | - * @since 9.1 |
|
79 | - */ |
|
80 | - public function getSection() { |
|
81 | - return 'security'; |
|
82 | - } |
|
76 | + /** |
|
77 | + * @return string the section ID, e.g. 'sharing' |
|
78 | + * @since 9.1 |
|
79 | + */ |
|
80 | + public function getSection() { |
|
81 | + return 'security'; |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @return int whether the form should be rather on the top or bottom of |
|
86 | - * the admin section. The forms are arranged in ascending order of the |
|
87 | - * priority values. It is required to return a value between 0 and 100. |
|
88 | - * |
|
89 | - * E.g.: 70 |
|
90 | - * @since 9.1 |
|
91 | - */ |
|
92 | - public function getPriority() { |
|
93 | - return 80; |
|
94 | - } |
|
84 | + /** |
|
85 | + * @return int whether the form should be rather on the top or bottom of |
|
86 | + * the admin section. The forms are arranged in ascending order of the |
|
87 | + * priority values. It is required to return a value between 0 and 100. |
|
88 | + * |
|
89 | + * E.g.: 70 |
|
90 | + * @since 9.1 |
|
91 | + */ |
|
92 | + public function getPriority() { |
|
93 | + return 80; |
|
94 | + } |
|
95 | 95 | } |