@@ -28,27 +28,27 @@ |
||
28 | 28 | use OCP\Util; |
29 | 29 | |
30 | 30 | class Application extends App { |
31 | - public function __construct () { |
|
32 | - parent::__construct('twofactor_backupcodes'); |
|
33 | - } |
|
31 | + public function __construct () { |
|
32 | + parent::__construct('twofactor_backupcodes'); |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * Register the different app parts |
|
37 | - */ |
|
38 | - public function register() { |
|
39 | - $this->registerHooksAndEvents(); |
|
40 | - } |
|
35 | + /** |
|
36 | + * Register the different app parts |
|
37 | + */ |
|
38 | + public function register() { |
|
39 | + $this->registerHooksAndEvents(); |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * Register the hooks and events |
|
44 | - */ |
|
45 | - public function registerHooksAndEvents() { |
|
46 | - Util::connectHook('OC_User', 'post_deleteUser', $this, 'deleteUser'); |
|
47 | - } |
|
42 | + /** |
|
43 | + * Register the hooks and events |
|
44 | + */ |
|
45 | + public function registerHooksAndEvents() { |
|
46 | + Util::connectHook('OC_User', 'post_deleteUser', $this, 'deleteUser'); |
|
47 | + } |
|
48 | 48 | |
49 | - public function deleteUser($params) { |
|
50 | - /** @var BackupCodeMapper $mapper */ |
|
51 | - $mapper = $this->getContainer()->query(BackupCodeMapper::class); |
|
52 | - $mapper->deleteCodesByUserId($params['uid']); |
|
53 | - } |
|
49 | + public function deleteUser($params) { |
|
50 | + /** @var BackupCodeMapper $mapper */ |
|
51 | + $mapper = $this->getContainer()->query(BackupCodeMapper::class); |
|
52 | + $mapper->deleteCodesByUserId($params['uid']); |
|
53 | + } |
|
54 | 54 | } |
@@ -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 'encryption'; |
|
82 | - } |
|
76 | + /** |
|
77 | + * @return string the section ID, e.g. 'sharing' |
|
78 | + * @since 9.1 |
|
79 | + */ |
|
80 | + public function getSection() { |
|
81 | + return 'encryption'; |
|
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 10; |
|
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 10; |
|
94 | + } |
|
95 | 95 | } |
@@ -48,222 +48,222 @@ |
||
48 | 48 | |
49 | 49 | class Application extends \OCP\AppFramework\App { |
50 | 50 | |
51 | - /** @var IManager */ |
|
52 | - private $encryptionManager; |
|
53 | - /** @var IConfig */ |
|
54 | - private $config; |
|
55 | - |
|
56 | - /** |
|
57 | - * @param array $urlParams |
|
58 | - * @param bool $encryptionSystemReady |
|
59 | - */ |
|
60 | - public function __construct($urlParams = array(), $encryptionSystemReady = true) { |
|
61 | - parent::__construct('encryption', $urlParams); |
|
62 | - $this->encryptionManager = \OC::$server->getEncryptionManager(); |
|
63 | - $this->config = \OC::$server->getConfig(); |
|
64 | - $this->registerServices(); |
|
65 | - if($encryptionSystemReady === false) { |
|
66 | - /** @var Session $session */ |
|
67 | - $session = $this->getContainer()->query('Session'); |
|
68 | - $session->setStatus(Session::RUN_MIGRATION); |
|
69 | - } |
|
70 | - if ($this->encryptionManager->isEnabled() && $encryptionSystemReady) { |
|
71 | - /** @var Setup $setup */ |
|
72 | - $setup = $this->getContainer()->query('UserSetup'); |
|
73 | - $setup->setupSystem(); |
|
74 | - } |
|
75 | - } |
|
76 | - |
|
77 | - /** |
|
78 | - * register hooks |
|
79 | - */ |
|
80 | - |
|
81 | - public function registerHooks() { |
|
82 | - if (!$this->config->getSystemValue('maintenance', false)) { |
|
83 | - |
|
84 | - $container = $this->getContainer(); |
|
85 | - $server = $container->getServer(); |
|
86 | - // Register our hooks and fire them. |
|
87 | - $hookManager = new HookManager(); |
|
88 | - |
|
89 | - $hookManager->registerHook([ |
|
90 | - new UserHooks($container->query('KeyManager'), |
|
91 | - $server->getUserManager(), |
|
92 | - $server->getLogger(), |
|
93 | - $container->query('UserSetup'), |
|
94 | - $server->getUserSession(), |
|
95 | - $container->query('Util'), |
|
96 | - $container->query('Session'), |
|
97 | - $container->query('Crypt'), |
|
98 | - $container->query('Recovery')) |
|
99 | - ]); |
|
100 | - |
|
101 | - $hookManager->fireHooks(); |
|
102 | - |
|
103 | - } else { |
|
104 | - // Logout user if we are in maintenance to force re-login |
|
105 | - $this->getContainer()->getServer()->getUserSession()->logout(); |
|
106 | - } |
|
107 | - } |
|
108 | - |
|
109 | - public function registerEncryptionModule() { |
|
110 | - $container = $this->getContainer(); |
|
111 | - |
|
112 | - |
|
113 | - $this->encryptionManager->registerEncryptionModule( |
|
114 | - Encryption::ID, |
|
115 | - Encryption::DISPLAY_NAME, |
|
116 | - function() use ($container) { |
|
117 | - |
|
118 | - return new Encryption( |
|
119 | - $container->query('Crypt'), |
|
120 | - $container->query('KeyManager'), |
|
121 | - $container->query('Util'), |
|
122 | - $container->query('Session'), |
|
123 | - $container->query('EncryptAll'), |
|
124 | - $container->query('DecryptAll'), |
|
125 | - $container->getServer()->getLogger(), |
|
126 | - $container->getServer()->getL10N($container->getAppName()) |
|
127 | - ); |
|
128 | - }); |
|
129 | - |
|
130 | - } |
|
131 | - |
|
132 | - public function registerServices() { |
|
133 | - $container = $this->getContainer(); |
|
134 | - |
|
135 | - $container->registerService('Crypt', |
|
136 | - function (IAppContainer $c) { |
|
137 | - $server = $c->getServer(); |
|
138 | - return new Crypt($server->getLogger(), |
|
139 | - $server->getUserSession(), |
|
140 | - $server->getConfig(), |
|
141 | - $server->getL10N($c->getAppName())); |
|
142 | - }); |
|
143 | - |
|
144 | - $container->registerService('Session', |
|
145 | - function (IAppContainer $c) { |
|
146 | - $server = $c->getServer(); |
|
147 | - return new Session($server->getSession()); |
|
148 | - } |
|
149 | - ); |
|
150 | - |
|
151 | - $container->registerService('KeyManager', |
|
152 | - function (IAppContainer $c) { |
|
153 | - $server = $c->getServer(); |
|
154 | - |
|
155 | - return new KeyManager($server->getEncryptionKeyStorage(), |
|
156 | - $c->query('Crypt'), |
|
157 | - $server->getConfig(), |
|
158 | - $server->getUserSession(), |
|
159 | - new Session($server->getSession()), |
|
160 | - $server->getLogger(), |
|
161 | - $c->query('Util') |
|
162 | - ); |
|
163 | - }); |
|
164 | - |
|
165 | - $container->registerService('Recovery', |
|
166 | - function (IAppContainer $c) { |
|
167 | - $server = $c->getServer(); |
|
168 | - |
|
169 | - return new Recovery( |
|
170 | - $server->getUserSession(), |
|
171 | - $c->query('Crypt'), |
|
172 | - $server->getSecureRandom(), |
|
173 | - $c->query('KeyManager'), |
|
174 | - $server->getConfig(), |
|
175 | - $server->getEncryptionKeyStorage(), |
|
176 | - $server->getEncryptionFilesHelper(), |
|
177 | - new View()); |
|
178 | - }); |
|
179 | - |
|
180 | - $container->registerService('RecoveryController', function (IAppContainer $c) { |
|
181 | - $server = $c->getServer(); |
|
182 | - return new RecoveryController( |
|
183 | - $c->getAppName(), |
|
184 | - $server->getRequest(), |
|
185 | - $server->getConfig(), |
|
186 | - $server->getL10N($c->getAppName()), |
|
187 | - $c->query('Recovery')); |
|
188 | - }); |
|
189 | - |
|
190 | - $container->registerService('StatusController', function (IAppContainer $c) { |
|
191 | - $server = $c->getServer(); |
|
192 | - return new StatusController( |
|
193 | - $c->getAppName(), |
|
194 | - $server->getRequest(), |
|
195 | - $server->getL10N($c->getAppName()), |
|
196 | - $c->query('Session') |
|
197 | - ); |
|
198 | - }); |
|
199 | - |
|
200 | - $container->registerService('SettingsController', function (IAppContainer $c) { |
|
201 | - $server = $c->getServer(); |
|
202 | - return new SettingsController( |
|
203 | - $c->getAppName(), |
|
204 | - $server->getRequest(), |
|
205 | - $server->getL10N($c->getAppName()), |
|
206 | - $server->getUserManager(), |
|
207 | - $server->getUserSession(), |
|
208 | - $c->query('KeyManager'), |
|
209 | - $c->query('Crypt'), |
|
210 | - $c->query('Session'), |
|
211 | - $server->getSession(), |
|
212 | - $c->query('Util') |
|
213 | - ); |
|
214 | - }); |
|
215 | - |
|
216 | - $container->registerService('UserSetup', |
|
217 | - function (IAppContainer $c) { |
|
218 | - $server = $c->getServer(); |
|
219 | - return new Setup($server->getLogger(), |
|
220 | - $server->getUserSession(), |
|
221 | - $c->query('Crypt'), |
|
222 | - $c->query('KeyManager')); |
|
223 | - }); |
|
224 | - |
|
225 | - $container->registerService('Util', |
|
226 | - function (IAppContainer $c) { |
|
227 | - $server = $c->getServer(); |
|
228 | - |
|
229 | - return new Util( |
|
230 | - new View(), |
|
231 | - $c->query('Crypt'), |
|
232 | - $server->getLogger(), |
|
233 | - $server->getUserSession(), |
|
234 | - $server->getConfig(), |
|
235 | - $server->getUserManager()); |
|
236 | - }); |
|
237 | - |
|
238 | - $container->registerService('EncryptAll', |
|
239 | - function (IAppContainer $c) { |
|
240 | - $server = $c->getServer(); |
|
241 | - return new EncryptAll( |
|
242 | - $c->query('UserSetup'), |
|
243 | - $c->getServer()->getUserManager(), |
|
244 | - new View(), |
|
245 | - $c->query('KeyManager'), |
|
246 | - $c->query('Util'), |
|
247 | - $server->getConfig(), |
|
248 | - $server->getMailer(), |
|
249 | - $server->getL10N('encryption'), |
|
250 | - new QuestionHelper(), |
|
251 | - $server->getSecureRandom() |
|
252 | - ); |
|
253 | - } |
|
254 | - ); |
|
255 | - |
|
256 | - $container->registerService('DecryptAll', |
|
257 | - function (IAppContainer $c) { |
|
258 | - return new DecryptAll( |
|
259 | - $c->query('Util'), |
|
260 | - $c->query('KeyManager'), |
|
261 | - $c->query('Crypt'), |
|
262 | - $c->query('Session'), |
|
263 | - new QuestionHelper() |
|
264 | - ); |
|
265 | - } |
|
266 | - ); |
|
267 | - |
|
268 | - } |
|
51 | + /** @var IManager */ |
|
52 | + private $encryptionManager; |
|
53 | + /** @var IConfig */ |
|
54 | + private $config; |
|
55 | + |
|
56 | + /** |
|
57 | + * @param array $urlParams |
|
58 | + * @param bool $encryptionSystemReady |
|
59 | + */ |
|
60 | + public function __construct($urlParams = array(), $encryptionSystemReady = true) { |
|
61 | + parent::__construct('encryption', $urlParams); |
|
62 | + $this->encryptionManager = \OC::$server->getEncryptionManager(); |
|
63 | + $this->config = \OC::$server->getConfig(); |
|
64 | + $this->registerServices(); |
|
65 | + if($encryptionSystemReady === false) { |
|
66 | + /** @var Session $session */ |
|
67 | + $session = $this->getContainer()->query('Session'); |
|
68 | + $session->setStatus(Session::RUN_MIGRATION); |
|
69 | + } |
|
70 | + if ($this->encryptionManager->isEnabled() && $encryptionSystemReady) { |
|
71 | + /** @var Setup $setup */ |
|
72 | + $setup = $this->getContainer()->query('UserSetup'); |
|
73 | + $setup->setupSystem(); |
|
74 | + } |
|
75 | + } |
|
76 | + |
|
77 | + /** |
|
78 | + * register hooks |
|
79 | + */ |
|
80 | + |
|
81 | + public function registerHooks() { |
|
82 | + if (!$this->config->getSystemValue('maintenance', false)) { |
|
83 | + |
|
84 | + $container = $this->getContainer(); |
|
85 | + $server = $container->getServer(); |
|
86 | + // Register our hooks and fire them. |
|
87 | + $hookManager = new HookManager(); |
|
88 | + |
|
89 | + $hookManager->registerHook([ |
|
90 | + new UserHooks($container->query('KeyManager'), |
|
91 | + $server->getUserManager(), |
|
92 | + $server->getLogger(), |
|
93 | + $container->query('UserSetup'), |
|
94 | + $server->getUserSession(), |
|
95 | + $container->query('Util'), |
|
96 | + $container->query('Session'), |
|
97 | + $container->query('Crypt'), |
|
98 | + $container->query('Recovery')) |
|
99 | + ]); |
|
100 | + |
|
101 | + $hookManager->fireHooks(); |
|
102 | + |
|
103 | + } else { |
|
104 | + // Logout user if we are in maintenance to force re-login |
|
105 | + $this->getContainer()->getServer()->getUserSession()->logout(); |
|
106 | + } |
|
107 | + } |
|
108 | + |
|
109 | + public function registerEncryptionModule() { |
|
110 | + $container = $this->getContainer(); |
|
111 | + |
|
112 | + |
|
113 | + $this->encryptionManager->registerEncryptionModule( |
|
114 | + Encryption::ID, |
|
115 | + Encryption::DISPLAY_NAME, |
|
116 | + function() use ($container) { |
|
117 | + |
|
118 | + return new Encryption( |
|
119 | + $container->query('Crypt'), |
|
120 | + $container->query('KeyManager'), |
|
121 | + $container->query('Util'), |
|
122 | + $container->query('Session'), |
|
123 | + $container->query('EncryptAll'), |
|
124 | + $container->query('DecryptAll'), |
|
125 | + $container->getServer()->getLogger(), |
|
126 | + $container->getServer()->getL10N($container->getAppName()) |
|
127 | + ); |
|
128 | + }); |
|
129 | + |
|
130 | + } |
|
131 | + |
|
132 | + public function registerServices() { |
|
133 | + $container = $this->getContainer(); |
|
134 | + |
|
135 | + $container->registerService('Crypt', |
|
136 | + function (IAppContainer $c) { |
|
137 | + $server = $c->getServer(); |
|
138 | + return new Crypt($server->getLogger(), |
|
139 | + $server->getUserSession(), |
|
140 | + $server->getConfig(), |
|
141 | + $server->getL10N($c->getAppName())); |
|
142 | + }); |
|
143 | + |
|
144 | + $container->registerService('Session', |
|
145 | + function (IAppContainer $c) { |
|
146 | + $server = $c->getServer(); |
|
147 | + return new Session($server->getSession()); |
|
148 | + } |
|
149 | + ); |
|
150 | + |
|
151 | + $container->registerService('KeyManager', |
|
152 | + function (IAppContainer $c) { |
|
153 | + $server = $c->getServer(); |
|
154 | + |
|
155 | + return new KeyManager($server->getEncryptionKeyStorage(), |
|
156 | + $c->query('Crypt'), |
|
157 | + $server->getConfig(), |
|
158 | + $server->getUserSession(), |
|
159 | + new Session($server->getSession()), |
|
160 | + $server->getLogger(), |
|
161 | + $c->query('Util') |
|
162 | + ); |
|
163 | + }); |
|
164 | + |
|
165 | + $container->registerService('Recovery', |
|
166 | + function (IAppContainer $c) { |
|
167 | + $server = $c->getServer(); |
|
168 | + |
|
169 | + return new Recovery( |
|
170 | + $server->getUserSession(), |
|
171 | + $c->query('Crypt'), |
|
172 | + $server->getSecureRandom(), |
|
173 | + $c->query('KeyManager'), |
|
174 | + $server->getConfig(), |
|
175 | + $server->getEncryptionKeyStorage(), |
|
176 | + $server->getEncryptionFilesHelper(), |
|
177 | + new View()); |
|
178 | + }); |
|
179 | + |
|
180 | + $container->registerService('RecoveryController', function (IAppContainer $c) { |
|
181 | + $server = $c->getServer(); |
|
182 | + return new RecoveryController( |
|
183 | + $c->getAppName(), |
|
184 | + $server->getRequest(), |
|
185 | + $server->getConfig(), |
|
186 | + $server->getL10N($c->getAppName()), |
|
187 | + $c->query('Recovery')); |
|
188 | + }); |
|
189 | + |
|
190 | + $container->registerService('StatusController', function (IAppContainer $c) { |
|
191 | + $server = $c->getServer(); |
|
192 | + return new StatusController( |
|
193 | + $c->getAppName(), |
|
194 | + $server->getRequest(), |
|
195 | + $server->getL10N($c->getAppName()), |
|
196 | + $c->query('Session') |
|
197 | + ); |
|
198 | + }); |
|
199 | + |
|
200 | + $container->registerService('SettingsController', function (IAppContainer $c) { |
|
201 | + $server = $c->getServer(); |
|
202 | + return new SettingsController( |
|
203 | + $c->getAppName(), |
|
204 | + $server->getRequest(), |
|
205 | + $server->getL10N($c->getAppName()), |
|
206 | + $server->getUserManager(), |
|
207 | + $server->getUserSession(), |
|
208 | + $c->query('KeyManager'), |
|
209 | + $c->query('Crypt'), |
|
210 | + $c->query('Session'), |
|
211 | + $server->getSession(), |
|
212 | + $c->query('Util') |
|
213 | + ); |
|
214 | + }); |
|
215 | + |
|
216 | + $container->registerService('UserSetup', |
|
217 | + function (IAppContainer $c) { |
|
218 | + $server = $c->getServer(); |
|
219 | + return new Setup($server->getLogger(), |
|
220 | + $server->getUserSession(), |
|
221 | + $c->query('Crypt'), |
|
222 | + $c->query('KeyManager')); |
|
223 | + }); |
|
224 | + |
|
225 | + $container->registerService('Util', |
|
226 | + function (IAppContainer $c) { |
|
227 | + $server = $c->getServer(); |
|
228 | + |
|
229 | + return new Util( |
|
230 | + new View(), |
|
231 | + $c->query('Crypt'), |
|
232 | + $server->getLogger(), |
|
233 | + $server->getUserSession(), |
|
234 | + $server->getConfig(), |
|
235 | + $server->getUserManager()); |
|
236 | + }); |
|
237 | + |
|
238 | + $container->registerService('EncryptAll', |
|
239 | + function (IAppContainer $c) { |
|
240 | + $server = $c->getServer(); |
|
241 | + return new EncryptAll( |
|
242 | + $c->query('UserSetup'), |
|
243 | + $c->getServer()->getUserManager(), |
|
244 | + new View(), |
|
245 | + $c->query('KeyManager'), |
|
246 | + $c->query('Util'), |
|
247 | + $server->getConfig(), |
|
248 | + $server->getMailer(), |
|
249 | + $server->getL10N('encryption'), |
|
250 | + new QuestionHelper(), |
|
251 | + $server->getSecureRandom() |
|
252 | + ); |
|
253 | + } |
|
254 | + ); |
|
255 | + |
|
256 | + $container->registerService('DecryptAll', |
|
257 | + function (IAppContainer $c) { |
|
258 | + return new DecryptAll( |
|
259 | + $c->query('Util'), |
|
260 | + $c->query('KeyManager'), |
|
261 | + $c->query('Crypt'), |
|
262 | + $c->query('Session'), |
|
263 | + new QuestionHelper() |
|
264 | + ); |
|
265 | + } |
|
266 | + ); |
|
267 | + |
|
268 | + } |
|
269 | 269 | } |
@@ -29,6 +29,6 @@ |
||
29 | 29 | |
30 | 30 | $app = new Application([], $encryptionSystemReady); |
31 | 31 | if ($encryptionSystemReady) { |
32 | - $app->registerEncryptionModule(); |
|
33 | - $app->registerHooks(); |
|
32 | + $app->registerEncryptionModule(); |
|
33 | + $app->registerHooks(); |
|
34 | 34 | } |
@@ -29,98 +29,98 @@ |
||
29 | 29 | use OCP\Settings\ISettings; |
30 | 30 | |
31 | 31 | trait CommonSettingsTrait { |
32 | - /** @var ISettingsManager */ |
|
33 | - private $settingsManager; |
|
34 | - |
|
35 | - /** |
|
36 | - * @param string $currentSection |
|
37 | - * @return array |
|
38 | - */ |
|
39 | - private function getNavigationParameters($currentType, $currentSection) { |
|
40 | - $templateParameters = [ |
|
41 | - 'personal' => $this->formatPersonalSections($currentType, $currentSection), |
|
42 | - 'admin' => [] |
|
43 | - ]; |
|
44 | - |
|
45 | - if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
46 | - $templateParameters['admin'] = $this->formatAdminSections($currentType, $currentSection); |
|
47 | - } |
|
48 | - |
|
49 | - return [ |
|
50 | - 'forms' => $templateParameters |
|
51 | - ]; |
|
52 | - } |
|
53 | - |
|
54 | - protected function formatSections($sections, $currentSection, $type, $currentType) { |
|
55 | - $templateParameters = []; |
|
56 | - /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
|
57 | - foreach($sections as $prioritizedSections) { |
|
58 | - foreach ($prioritizedSections as $section) { |
|
59 | - if($type === 'admin') { |
|
60 | - $settings = $this->settingsManager->getAdminSettings($section->getID()); |
|
61 | - } else if($type === 'personal') { |
|
62 | - $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
|
63 | - } |
|
64 | - if (empty($settings)) { |
|
65 | - continue; |
|
66 | - } |
|
67 | - |
|
68 | - $icon = ''; |
|
69 | - if ($section instanceof IIconSection) { |
|
70 | - $icon = $section->getIcon(); |
|
71 | - } |
|
72 | - |
|
73 | - $active = $section->getID() === $currentSection |
|
74 | - && $type === $currentType; |
|
75 | - |
|
76 | - $templateParameters[] = [ |
|
77 | - 'anchor' => $section->getID(), |
|
78 | - 'section-name' => $section->getName(), |
|
79 | - 'active' => $active, |
|
80 | - 'icon' => $icon, |
|
81 | - ]; |
|
82 | - } |
|
83 | - } |
|
84 | - return $templateParameters; |
|
85 | - } |
|
86 | - |
|
87 | - protected function formatPersonalSections($currentType, $currentSections) { |
|
88 | - $sections = $this->settingsManager->getPersonalSections(); |
|
89 | - $templateParameters = $this->formatSections($sections, $currentSections, 'personal', $currentType); |
|
90 | - |
|
91 | - return $templateParameters; |
|
92 | - } |
|
93 | - |
|
94 | - protected function formatAdminSections($currentType, $currentSections) { |
|
95 | - $sections = $this->settingsManager->getAdminSections(); |
|
96 | - $templateParameters = $this->formatSections($sections, $currentSections, 'admin', $currentType); |
|
97 | - |
|
98 | - return $templateParameters; |
|
99 | - } |
|
100 | - |
|
101 | - /** |
|
102 | - * @param ISettings[] $settings |
|
103 | - * @return array |
|
104 | - */ |
|
105 | - private function formatSettings($settings) { |
|
106 | - $html = ''; |
|
107 | - foreach ($settings as $prioritizedSettings) { |
|
108 | - foreach ($prioritizedSettings as $setting) { |
|
109 | - /** @var \OCP\Settings\ISettings $setting */ |
|
110 | - $form = $setting->getForm(); |
|
111 | - $html .= $form->renderAs('')->render(); |
|
112 | - } |
|
113 | - } |
|
114 | - return ['content' => $html]; |
|
115 | - } |
|
116 | - |
|
117 | - private function getIndexResponse($type, $section) { |
|
118 | - $templateParams = []; |
|
119 | - $templateParams = array_merge($templateParams, $this->getNavigationParameters($type, $section)); |
|
120 | - $templateParams = array_merge($templateParams, $this->getSettings($section)); |
|
121 | - |
|
122 | - return new TemplateResponse('settings', 'settings/frame', $templateParams); |
|
123 | - } |
|
124 | - |
|
125 | - abstract protected function getSettings($section); |
|
32 | + /** @var ISettingsManager */ |
|
33 | + private $settingsManager; |
|
34 | + |
|
35 | + /** |
|
36 | + * @param string $currentSection |
|
37 | + * @return array |
|
38 | + */ |
|
39 | + private function getNavigationParameters($currentType, $currentSection) { |
|
40 | + $templateParameters = [ |
|
41 | + 'personal' => $this->formatPersonalSections($currentType, $currentSection), |
|
42 | + 'admin' => [] |
|
43 | + ]; |
|
44 | + |
|
45 | + if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
46 | + $templateParameters['admin'] = $this->formatAdminSections($currentType, $currentSection); |
|
47 | + } |
|
48 | + |
|
49 | + return [ |
|
50 | + 'forms' => $templateParameters |
|
51 | + ]; |
|
52 | + } |
|
53 | + |
|
54 | + protected function formatSections($sections, $currentSection, $type, $currentType) { |
|
55 | + $templateParameters = []; |
|
56 | + /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
|
57 | + foreach($sections as $prioritizedSections) { |
|
58 | + foreach ($prioritizedSections as $section) { |
|
59 | + if($type === 'admin') { |
|
60 | + $settings = $this->settingsManager->getAdminSettings($section->getID()); |
|
61 | + } else if($type === 'personal') { |
|
62 | + $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
|
63 | + } |
|
64 | + if (empty($settings)) { |
|
65 | + continue; |
|
66 | + } |
|
67 | + |
|
68 | + $icon = ''; |
|
69 | + if ($section instanceof IIconSection) { |
|
70 | + $icon = $section->getIcon(); |
|
71 | + } |
|
72 | + |
|
73 | + $active = $section->getID() === $currentSection |
|
74 | + && $type === $currentType; |
|
75 | + |
|
76 | + $templateParameters[] = [ |
|
77 | + 'anchor' => $section->getID(), |
|
78 | + 'section-name' => $section->getName(), |
|
79 | + 'active' => $active, |
|
80 | + 'icon' => $icon, |
|
81 | + ]; |
|
82 | + } |
|
83 | + } |
|
84 | + return $templateParameters; |
|
85 | + } |
|
86 | + |
|
87 | + protected function formatPersonalSections($currentType, $currentSections) { |
|
88 | + $sections = $this->settingsManager->getPersonalSections(); |
|
89 | + $templateParameters = $this->formatSections($sections, $currentSections, 'personal', $currentType); |
|
90 | + |
|
91 | + return $templateParameters; |
|
92 | + } |
|
93 | + |
|
94 | + protected function formatAdminSections($currentType, $currentSections) { |
|
95 | + $sections = $this->settingsManager->getAdminSections(); |
|
96 | + $templateParameters = $this->formatSections($sections, $currentSections, 'admin', $currentType); |
|
97 | + |
|
98 | + return $templateParameters; |
|
99 | + } |
|
100 | + |
|
101 | + /** |
|
102 | + * @param ISettings[] $settings |
|
103 | + * @return array |
|
104 | + */ |
|
105 | + private function formatSettings($settings) { |
|
106 | + $html = ''; |
|
107 | + foreach ($settings as $prioritizedSettings) { |
|
108 | + foreach ($prioritizedSettings as $setting) { |
|
109 | + /** @var \OCP\Settings\ISettings $setting */ |
|
110 | + $form = $setting->getForm(); |
|
111 | + $html .= $form->renderAs('')->render(); |
|
112 | + } |
|
113 | + } |
|
114 | + return ['content' => $html]; |
|
115 | + } |
|
116 | + |
|
117 | + private function getIndexResponse($type, $section) { |
|
118 | + $templateParams = []; |
|
119 | + $templateParams = array_merge($templateParams, $this->getNavigationParameters($type, $section)); |
|
120 | + $templateParams = array_merge($templateParams, $this->getSettings($section)); |
|
121 | + |
|
122 | + return new TemplateResponse('settings', 'settings/frame', $templateParams); |
|
123 | + } |
|
124 | + |
|
125 | + abstract protected function getSettings($section); |
|
126 | 126 | } |
@@ -31,76 +31,76 @@ |
||
31 | 31 | use OCP\Template; |
32 | 32 | |
33 | 33 | class PersonalSettingsController extends Controller { |
34 | - use CommonSettingsTrait; |
|
34 | + use CommonSettingsTrait; |
|
35 | 35 | |
36 | - /** @var INavigationManager */ |
|
37 | - private $navigationManager; |
|
36 | + /** @var INavigationManager */ |
|
37 | + private $navigationManager; |
|
38 | 38 | |
39 | - public function __construct( |
|
40 | - $appName, |
|
41 | - IRequest $request, |
|
42 | - INavigationManager $navigationManager, |
|
43 | - ISettingsManager $settingsManager |
|
44 | - ) { |
|
45 | - parent::__construct($appName, $request); |
|
46 | - $this->navigationManager = $navigationManager; |
|
47 | - $this->settingsManager = $settingsManager; |
|
48 | - } |
|
39 | + public function __construct( |
|
40 | + $appName, |
|
41 | + IRequest $request, |
|
42 | + INavigationManager $navigationManager, |
|
43 | + ISettingsManager $settingsManager |
|
44 | + ) { |
|
45 | + parent::__construct($appName, $request); |
|
46 | + $this->navigationManager = $navigationManager; |
|
47 | + $this->settingsManager = $settingsManager; |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * @param string $section |
|
52 | - * @return TemplateResponse |
|
53 | - * |
|
54 | - * @NoCSRFRequired |
|
55 | - * @NoAdminRequired |
|
56 | - * @NoSubadminRequired |
|
57 | - */ |
|
58 | - public function index($section) { |
|
59 | - $this->navigationManager->setActiveEntry('personal'); |
|
60 | - return $this->getIndexResponse('personal', $section); |
|
50 | + /** |
|
51 | + * @param string $section |
|
52 | + * @return TemplateResponse |
|
53 | + * |
|
54 | + * @NoCSRFRequired |
|
55 | + * @NoAdminRequired |
|
56 | + * @NoSubadminRequired |
|
57 | + */ |
|
58 | + public function index($section) { |
|
59 | + $this->navigationManager->setActiveEntry('personal'); |
|
60 | + return $this->getIndexResponse('personal', $section); |
|
61 | 61 | |
62 | - } |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param string $section |
|
66 | - * @return array |
|
67 | - */ |
|
68 | - protected function getSettings($section) { |
|
69 | - $settings = $this->settingsManager->getPersonalSettings($section); |
|
70 | - $formatted = $this->formatSettings($settings); |
|
71 | - if($section === 'additional') { |
|
72 | - $formatted['content'] .= $this->getLegacyForms(); |
|
73 | - } |
|
74 | - return $formatted; |
|
75 | - } |
|
64 | + /** |
|
65 | + * @param string $section |
|
66 | + * @return array |
|
67 | + */ |
|
68 | + protected function getSettings($section) { |
|
69 | + $settings = $this->settingsManager->getPersonalSettings($section); |
|
70 | + $formatted = $this->formatSettings($settings); |
|
71 | + if($section === 'additional') { |
|
72 | + $formatted['content'] .= $this->getLegacyForms(); |
|
73 | + } |
|
74 | + return $formatted; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * @return bool|string |
|
79 | - */ |
|
80 | - private function getLegacyForms() { |
|
81 | - $forms = \OC_App::getForms('personal'); |
|
77 | + /** |
|
78 | + * @return bool|string |
|
79 | + */ |
|
80 | + private function getLegacyForms() { |
|
81 | + $forms = \OC_App::getForms('personal'); |
|
82 | 82 | |
83 | - $forms = array_map(function ($form) { |
|
84 | - if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
|
85 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
86 | - $sectionName = str_replace('</h2>', '', $sectionName); |
|
87 | - $anchor = strtolower($sectionName); |
|
88 | - $anchor = str_replace(' ', '-', $anchor); |
|
83 | + $forms = array_map(function ($form) { |
|
84 | + if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
|
85 | + $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
86 | + $sectionName = str_replace('</h2>', '', $sectionName); |
|
87 | + $anchor = strtolower($sectionName); |
|
88 | + $anchor = str_replace(' ', '-', $anchor); |
|
89 | 89 | |
90 | - return array( |
|
91 | - 'anchor' => $anchor, |
|
92 | - 'section-name' => $sectionName, |
|
93 | - 'form' => $form |
|
94 | - ); |
|
95 | - } |
|
96 | - return array( |
|
97 | - 'form' => $form |
|
98 | - ); |
|
99 | - }, $forms); |
|
90 | + return array( |
|
91 | + 'anchor' => $anchor, |
|
92 | + 'section-name' => $sectionName, |
|
93 | + 'form' => $form |
|
94 | + ); |
|
95 | + } |
|
96 | + return array( |
|
97 | + 'form' => $form |
|
98 | + ); |
|
99 | + }, $forms); |
|
100 | 100 | |
101 | - $out = new Template('settings', 'settings/additional'); |
|
102 | - $out->assign('forms', $forms); |
|
101 | + $out = new Template('settings', 'settings/additional'); |
|
102 | + $out->assign('forms', $forms); |
|
103 | 103 | |
104 | - return $out->fetchPage(); |
|
105 | - } |
|
104 | + return $out->fetchPage(); |
|
105 | + } |
|
106 | 106 | } |
@@ -35,81 +35,81 @@ |
||
35 | 35 | * @package OC\Settings\Controller |
36 | 36 | */ |
37 | 37 | class AdminSettingsController extends Controller { |
38 | - use CommonSettingsTrait; |
|
38 | + use CommonSettingsTrait; |
|
39 | 39 | |
40 | - /** @var INavigationManager */ |
|
41 | - private $navigationManager; |
|
40 | + /** @var INavigationManager */ |
|
41 | + private $navigationManager; |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param string $appName |
|
45 | - * @param IRequest $request |
|
46 | - * @param INavigationManager $navigationManager |
|
47 | - * @param ISettingsManager $settingsManager |
|
48 | - */ |
|
49 | - public function __construct( |
|
50 | - $appName, |
|
51 | - IRequest $request, |
|
52 | - INavigationManager $navigationManager, |
|
53 | - ISettingsManager $settingsManager |
|
54 | - ) { |
|
55 | - parent::__construct($appName, $request); |
|
56 | - $this->navigationManager = $navigationManager; |
|
57 | - $this->settingsManager = $settingsManager; |
|
58 | - } |
|
43 | + /** |
|
44 | + * @param string $appName |
|
45 | + * @param IRequest $request |
|
46 | + * @param INavigationManager $navigationManager |
|
47 | + * @param ISettingsManager $settingsManager |
|
48 | + */ |
|
49 | + public function __construct( |
|
50 | + $appName, |
|
51 | + IRequest $request, |
|
52 | + INavigationManager $navigationManager, |
|
53 | + ISettingsManager $settingsManager |
|
54 | + ) { |
|
55 | + parent::__construct($appName, $request); |
|
56 | + $this->navigationManager = $navigationManager; |
|
57 | + $this->settingsManager = $settingsManager; |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @param string $section |
|
62 | - * @return TemplateResponse |
|
63 | - * |
|
64 | - * @NoCSRFRequired |
|
65 | - */ |
|
66 | - public function index($section) { |
|
67 | - $this->navigationManager->setActiveEntry('admin'); |
|
68 | - return $this->getIndexResponse('admin', $section); |
|
69 | - } |
|
60 | + /** |
|
61 | + * @param string $section |
|
62 | + * @return TemplateResponse |
|
63 | + * |
|
64 | + * @NoCSRFRequired |
|
65 | + */ |
|
66 | + public function index($section) { |
|
67 | + $this->navigationManager->setActiveEntry('admin'); |
|
68 | + return $this->getIndexResponse('admin', $section); |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @param string $section |
|
73 | - * @return array |
|
74 | - */ |
|
75 | - protected function getSettings($section) { |
|
76 | - $settings = $this->settingsManager->getAdminSettings($section); |
|
77 | - $formatted = $this->formatSettings($settings); |
|
78 | - if($section === 'additional') { |
|
79 | - $formatted['content'] .= $this->getLegacyForms(); |
|
80 | - } |
|
81 | - return $formatted; |
|
82 | - } |
|
71 | + /** |
|
72 | + * @param string $section |
|
73 | + * @return array |
|
74 | + */ |
|
75 | + protected function getSettings($section) { |
|
76 | + $settings = $this->settingsManager->getAdminSettings($section); |
|
77 | + $formatted = $this->formatSettings($settings); |
|
78 | + if($section === 'additional') { |
|
79 | + $formatted['content'] .= $this->getLegacyForms(); |
|
80 | + } |
|
81 | + return $formatted; |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @return bool|string |
|
86 | - */ |
|
87 | - private function getLegacyForms() { |
|
88 | - $forms = \OC_App::getForms('admin'); |
|
84 | + /** |
|
85 | + * @return bool|string |
|
86 | + */ |
|
87 | + private function getLegacyForms() { |
|
88 | + $forms = \OC_App::getForms('admin'); |
|
89 | 89 | |
90 | - $forms = array_map(function ($form) { |
|
91 | - if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
|
92 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
93 | - $sectionName = str_replace('</h2>', '', $sectionName); |
|
94 | - $anchor = strtolower($sectionName); |
|
95 | - $anchor = str_replace(' ', '-', $anchor); |
|
90 | + $forms = array_map(function ($form) { |
|
91 | + if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
|
92 | + $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
93 | + $sectionName = str_replace('</h2>', '', $sectionName); |
|
94 | + $anchor = strtolower($sectionName); |
|
95 | + $anchor = str_replace(' ', '-', $anchor); |
|
96 | 96 | |
97 | - return array( |
|
98 | - 'anchor' => $anchor, |
|
99 | - 'section-name' => $sectionName, |
|
100 | - 'form' => $form |
|
101 | - ); |
|
102 | - } |
|
103 | - return array( |
|
104 | - 'form' => $form |
|
105 | - ); |
|
106 | - }, $forms); |
|
97 | + return array( |
|
98 | + 'anchor' => $anchor, |
|
99 | + 'section-name' => $sectionName, |
|
100 | + 'form' => $form |
|
101 | + ); |
|
102 | + } |
|
103 | + return array( |
|
104 | + 'form' => $form |
|
105 | + ); |
|
106 | + }, $forms); |
|
107 | 107 | |
108 | - $out = new Template('settings', 'settings/additional'); |
|
109 | - $out->assign('forms', $forms); |
|
108 | + $out = new Template('settings', 'settings/additional'); |
|
109 | + $out->assign('forms', $forms); |
|
110 | 110 | |
111 | - return $out->fetchPage(); |
|
112 | - } |
|
111 | + return $out->fetchPage(); |
|
112 | + } |
|
113 | 113 | |
114 | 114 | |
115 | 115 | } |
@@ -39,246 +39,246 @@ |
||
39 | 39 | use OCP\Settings\ISettings; |
40 | 40 | |
41 | 41 | class PersonalInfo implements ISettings { |
42 | - /** @var IConfig */ |
|
43 | - private $config; |
|
44 | - /** @var IUserManager */ |
|
45 | - private $userManager; |
|
46 | - /** @var AccountManager */ |
|
47 | - private $accountManager; |
|
48 | - /** @var IGroupManager */ |
|
49 | - private $groupManager; |
|
50 | - /** @var IAppManager */ |
|
51 | - private $appManager; |
|
52 | - /** @var IFactory */ |
|
53 | - private $l10nFactory; |
|
42 | + /** @var IConfig */ |
|
43 | + private $config; |
|
44 | + /** @var IUserManager */ |
|
45 | + private $userManager; |
|
46 | + /** @var AccountManager */ |
|
47 | + private $accountManager; |
|
48 | + /** @var IGroupManager */ |
|
49 | + private $groupManager; |
|
50 | + /** @var IAppManager */ |
|
51 | + private $appManager; |
|
52 | + /** @var IFactory */ |
|
53 | + private $l10nFactory; |
|
54 | 54 | |
55 | - const COMMON_LANGUAGE_CODES = [ |
|
56 | - 'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', |
|
57 | - 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko' |
|
58 | - ]; |
|
55 | + const COMMON_LANGUAGE_CODES = [ |
|
56 | + 'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', |
|
57 | + 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko' |
|
58 | + ]; |
|
59 | 59 | |
60 | - /** @var IL10N */ |
|
61 | - private $l; |
|
60 | + /** @var IL10N */ |
|
61 | + private $l; |
|
62 | 62 | |
63 | - /** |
|
64 | - * @param IConfig $config |
|
65 | - * @param IUserManager $userManager |
|
66 | - * @param IGroupManager $groupManager |
|
67 | - * @param AccountManager $accountManager |
|
68 | - * @param IFactory $l10nFactory |
|
69 | - * @param IL10N $l |
|
70 | - */ |
|
71 | - public function __construct( |
|
72 | - IConfig $config, |
|
73 | - IUserManager $userManager, |
|
74 | - IGroupManager $groupManager, |
|
75 | - AccountManager $accountManager, |
|
76 | - IAppManager $appManager, |
|
77 | - IFactory $l10nFactory, |
|
78 | - IL10N $l |
|
79 | - ) { |
|
80 | - $this->config = $config; |
|
81 | - $this->userManager = $userManager; |
|
82 | - $this->accountManager = $accountManager; |
|
83 | - $this->groupManager = $groupManager; |
|
84 | - $this->appManager = $appManager; |
|
85 | - $this->l10nFactory = $l10nFactory; |
|
86 | - $this->l = $l; |
|
87 | - } |
|
63 | + /** |
|
64 | + * @param IConfig $config |
|
65 | + * @param IUserManager $userManager |
|
66 | + * @param IGroupManager $groupManager |
|
67 | + * @param AccountManager $accountManager |
|
68 | + * @param IFactory $l10nFactory |
|
69 | + * @param IL10N $l |
|
70 | + */ |
|
71 | + public function __construct( |
|
72 | + IConfig $config, |
|
73 | + IUserManager $userManager, |
|
74 | + IGroupManager $groupManager, |
|
75 | + AccountManager $accountManager, |
|
76 | + IAppManager $appManager, |
|
77 | + IFactory $l10nFactory, |
|
78 | + IL10N $l |
|
79 | + ) { |
|
80 | + $this->config = $config; |
|
81 | + $this->userManager = $userManager; |
|
82 | + $this->accountManager = $accountManager; |
|
83 | + $this->groupManager = $groupManager; |
|
84 | + $this->appManager = $appManager; |
|
85 | + $this->l10nFactory = $l10nFactory; |
|
86 | + $this->l = $l; |
|
87 | + } |
|
88 | 88 | |
89 | - /** |
|
90 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
91 | - * @since 9.1 |
|
92 | - */ |
|
93 | - public function getForm() { |
|
94 | - $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing'); |
|
95 | - $lookupServerUploadEnabled = false; |
|
96 | - if($federatedFileSharingEnabled) { |
|
97 | - $federatedFileSharing = new Application(); |
|
98 | - $shareProvider = $federatedFileSharing->getFederatedShareProvider(); |
|
99 | - $lookupServerUploadEnabled = $shareProvider->isLookupServerUploadEnabled(); |
|
100 | - } |
|
89 | + /** |
|
90 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
91 | + * @since 9.1 |
|
92 | + */ |
|
93 | + public function getForm() { |
|
94 | + $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing'); |
|
95 | + $lookupServerUploadEnabled = false; |
|
96 | + if($federatedFileSharingEnabled) { |
|
97 | + $federatedFileSharing = new Application(); |
|
98 | + $shareProvider = $federatedFileSharing->getFederatedShareProvider(); |
|
99 | + $lookupServerUploadEnabled = $shareProvider->isLookupServerUploadEnabled(); |
|
100 | + } |
|
101 | 101 | |
102 | - $uid = \OC_User::getUser(); |
|
103 | - $user = $this->userManager->get($uid); |
|
104 | - $userData = $this->accountManager->getUser($user); |
|
102 | + $uid = \OC_User::getUser(); |
|
103 | + $user = $this->userManager->get($uid); |
|
104 | + $userData = $this->accountManager->getUser($user); |
|
105 | 105 | |
106 | - $storageInfo = \OC_Helper::getStorageInfo('/'); |
|
107 | - if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) { |
|
108 | - $totalSpace = $this->l->t('Unlimited'); |
|
109 | - } else { |
|
110 | - $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']); |
|
111 | - } |
|
106 | + $storageInfo = \OC_Helper::getStorageInfo('/'); |
|
107 | + if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) { |
|
108 | + $totalSpace = $this->l->t('Unlimited'); |
|
109 | + } else { |
|
110 | + $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']); |
|
111 | + } |
|
112 | 112 | |
113 | - $languageParameters = $this->getLanguages($user); |
|
114 | - $messageParameters = $this->getMessageParameters($userData); |
|
113 | + $languageParameters = $this->getLanguages($user); |
|
114 | + $messageParameters = $this->getMessageParameters($userData); |
|
115 | 115 | |
116 | - $parameters = [ |
|
117 | - 'total_space' => $totalSpace, |
|
118 | - 'usage' => \OC_Helper::humanFileSize($storageInfo['used']), |
|
119 | - 'usage_relative' => $storageInfo['relative'], |
|
120 | - 'quota' => $storageInfo['quota'], |
|
121 | - 'avatarChangeSupported' => \OC_User::canUserChangeAvatar($uid), |
|
122 | - 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, |
|
123 | - 'avatarScope' => $userData[AccountManager::PROPERTY_AVATAR]['scope'], |
|
124 | - 'displayNameChangeSupported' => \OC_User::canUserChangeDisplayName($uid), |
|
125 | - 'displayName' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['value'], |
|
126 | - 'displayNameScope' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['scope'], |
|
127 | - 'email' => $userData[AccountManager::PROPERTY_EMAIL]['value'], |
|
128 | - 'emailScope' => $userData[AccountManager::PROPERTY_EMAIL]['scope'], |
|
129 | - 'emailVerification' => $userData[AccountManager::PROPERTY_EMAIL]['verified'], |
|
130 | - 'phone' => $userData[AccountManager::PROPERTY_PHONE]['value'], |
|
131 | - 'phoneScope' => $userData[AccountManager::PROPERTY_PHONE]['scope'], |
|
132 | - 'address' => $userData[AccountManager::PROPERTY_ADDRESS]['value'], |
|
133 | - 'addressScope' => $userData[AccountManager::PROPERTY_ADDRESS]['scope'], |
|
134 | - 'website' => $userData[AccountManager::PROPERTY_WEBSITE]['value'], |
|
135 | - 'websiteScope' => $userData[AccountManager::PROPERTY_WEBSITE]['scope'], |
|
136 | - 'websiteVerification' => $userData[AccountManager::PROPERTY_WEBSITE]['verified'], |
|
137 | - 'twitter' => $userData[AccountManager::PROPERTY_TWITTER]['value'], |
|
138 | - 'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'], |
|
139 | - 'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'], |
|
140 | - 'groups' => $this->getGroups($user), |
|
141 | - 'passwordChangeSupported' => \OC_User::canUserChangePassword($uid), |
|
142 | - ] + $messageParameters + $languageParameters; |
|
116 | + $parameters = [ |
|
117 | + 'total_space' => $totalSpace, |
|
118 | + 'usage' => \OC_Helper::humanFileSize($storageInfo['used']), |
|
119 | + 'usage_relative' => $storageInfo['relative'], |
|
120 | + 'quota' => $storageInfo['quota'], |
|
121 | + 'avatarChangeSupported' => \OC_User::canUserChangeAvatar($uid), |
|
122 | + 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, |
|
123 | + 'avatarScope' => $userData[AccountManager::PROPERTY_AVATAR]['scope'], |
|
124 | + 'displayNameChangeSupported' => \OC_User::canUserChangeDisplayName($uid), |
|
125 | + 'displayName' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['value'], |
|
126 | + 'displayNameScope' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['scope'], |
|
127 | + 'email' => $userData[AccountManager::PROPERTY_EMAIL]['value'], |
|
128 | + 'emailScope' => $userData[AccountManager::PROPERTY_EMAIL]['scope'], |
|
129 | + 'emailVerification' => $userData[AccountManager::PROPERTY_EMAIL]['verified'], |
|
130 | + 'phone' => $userData[AccountManager::PROPERTY_PHONE]['value'], |
|
131 | + 'phoneScope' => $userData[AccountManager::PROPERTY_PHONE]['scope'], |
|
132 | + 'address' => $userData[AccountManager::PROPERTY_ADDRESS]['value'], |
|
133 | + 'addressScope' => $userData[AccountManager::PROPERTY_ADDRESS]['scope'], |
|
134 | + 'website' => $userData[AccountManager::PROPERTY_WEBSITE]['value'], |
|
135 | + 'websiteScope' => $userData[AccountManager::PROPERTY_WEBSITE]['scope'], |
|
136 | + 'websiteVerification' => $userData[AccountManager::PROPERTY_WEBSITE]['verified'], |
|
137 | + 'twitter' => $userData[AccountManager::PROPERTY_TWITTER]['value'], |
|
138 | + 'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'], |
|
139 | + 'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'], |
|
140 | + 'groups' => $this->getGroups($user), |
|
141 | + 'passwordChangeSupported' => \OC_User::canUserChangePassword($uid), |
|
142 | + ] + $messageParameters + $languageParameters; |
|
143 | 143 | |
144 | 144 | |
145 | - return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, ''); |
|
146 | - } |
|
145 | + return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, ''); |
|
146 | + } |
|
147 | 147 | |
148 | - /** |
|
149 | - * @return string the section ID, e.g. 'sharing' |
|
150 | - * @since 9.1 |
|
151 | - */ |
|
152 | - public function getSection() { |
|
153 | - return 'personal-info'; |
|
154 | - } |
|
148 | + /** |
|
149 | + * @return string the section ID, e.g. 'sharing' |
|
150 | + * @since 9.1 |
|
151 | + */ |
|
152 | + public function getSection() { |
|
153 | + return 'personal-info'; |
|
154 | + } |
|
155 | 155 | |
156 | - /** |
|
157 | - * @return int whether the form should be rather on the top or bottom of |
|
158 | - * the admin section. The forms are arranged in ascending order of the |
|
159 | - * priority values. It is required to return a value between 0 and 100. |
|
160 | - * |
|
161 | - * E.g.: 70 |
|
162 | - * @since 9.1 |
|
163 | - */ |
|
164 | - public function getPriority() { |
|
165 | - return 10; |
|
166 | - } |
|
156 | + /** |
|
157 | + * @return int whether the form should be rather on the top or bottom of |
|
158 | + * the admin section. The forms are arranged in ascending order of the |
|
159 | + * priority values. It is required to return a value between 0 and 100. |
|
160 | + * |
|
161 | + * E.g.: 70 |
|
162 | + * @since 9.1 |
|
163 | + */ |
|
164 | + public function getPriority() { |
|
165 | + return 10; |
|
166 | + } |
|
167 | 167 | |
168 | - /** |
|
169 | - * returns a sorted list of the user's group GIDs |
|
170 | - * |
|
171 | - * @param IUser $user |
|
172 | - * @return array |
|
173 | - */ |
|
174 | - private function getGroups(IUser $user) { |
|
175 | - $groups = array_map( |
|
176 | - function(IGroup $group) { |
|
177 | - return $group->getGID(); |
|
178 | - }, |
|
179 | - $this->groupManager->getUserGroups($user) |
|
180 | - ); |
|
181 | - sort($groups); |
|
168 | + /** |
|
169 | + * returns a sorted list of the user's group GIDs |
|
170 | + * |
|
171 | + * @param IUser $user |
|
172 | + * @return array |
|
173 | + */ |
|
174 | + private function getGroups(IUser $user) { |
|
175 | + $groups = array_map( |
|
176 | + function(IGroup $group) { |
|
177 | + return $group->getGID(); |
|
178 | + }, |
|
179 | + $this->groupManager->getUserGroups($user) |
|
180 | + ); |
|
181 | + sort($groups); |
|
182 | 182 | |
183 | - return $groups; |
|
184 | - } |
|
183 | + return $groups; |
|
184 | + } |
|
185 | 185 | |
186 | - /** |
|
187 | - * returns the user language, common language and other languages in an |
|
188 | - * associative array |
|
189 | - * |
|
190 | - * @param IUser $user |
|
191 | - * @return array |
|
192 | - */ |
|
193 | - private function getLanguages(IUser $user) { |
|
194 | - $forceLanguage = $this->config->getSystemValue('force_language', false); |
|
195 | - if($forceLanguage !== false) { |
|
196 | - return []; |
|
197 | - } |
|
186 | + /** |
|
187 | + * returns the user language, common language and other languages in an |
|
188 | + * associative array |
|
189 | + * |
|
190 | + * @param IUser $user |
|
191 | + * @return array |
|
192 | + */ |
|
193 | + private function getLanguages(IUser $user) { |
|
194 | + $forceLanguage = $this->config->getSystemValue('force_language', false); |
|
195 | + if($forceLanguage !== false) { |
|
196 | + return []; |
|
197 | + } |
|
198 | 198 | |
199 | - $uid = $user->getUID(); |
|
199 | + $uid = $user->getUID(); |
|
200 | 200 | |
201 | - $userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage()); |
|
202 | - $languageCodes = $this->l10nFactory->findAvailableLanguages(); |
|
201 | + $userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage()); |
|
202 | + $languageCodes = $this->l10nFactory->findAvailableLanguages(); |
|
203 | 203 | |
204 | - $commonLanguages = []; |
|
205 | - $languages = []; |
|
204 | + $commonLanguages = []; |
|
205 | + $languages = []; |
|
206 | 206 | |
207 | - foreach($languageCodes as $lang) { |
|
208 | - $l = \OC::$server->getL10N('settings', $lang); |
|
209 | - // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version |
|
210 | - $potentialName = (string) $l->t('__language_name__'); |
|
211 | - if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file |
|
212 | - $ln = array('code' => $lang, 'name' => $potentialName); |
|
213 | - } elseif ($lang === 'en') { |
|
214 | - $ln = ['code' => $lang, 'name' => 'English (US)']; |
|
215 | - }else{//fallback to language code |
|
216 | - $ln=array('code'=>$lang, 'name'=>$lang); |
|
217 | - } |
|
207 | + foreach($languageCodes as $lang) { |
|
208 | + $l = \OC::$server->getL10N('settings', $lang); |
|
209 | + // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version |
|
210 | + $potentialName = (string) $l->t('__language_name__'); |
|
211 | + if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file |
|
212 | + $ln = array('code' => $lang, 'name' => $potentialName); |
|
213 | + } elseif ($lang === 'en') { |
|
214 | + $ln = ['code' => $lang, 'name' => 'English (US)']; |
|
215 | + }else{//fallback to language code |
|
216 | + $ln=array('code'=>$lang, 'name'=>$lang); |
|
217 | + } |
|
218 | 218 | |
219 | - // put appropriate languages into appropriate arrays, to print them sorted |
|
220 | - // used language -> common languages -> divider -> other languages |
|
221 | - if ($lang === $userLang) { |
|
222 | - $userLang = $ln; |
|
223 | - } elseif (in_array($lang, self::COMMON_LANGUAGE_CODES)) { |
|
224 | - $commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES)]=$ln; |
|
225 | - } else { |
|
226 | - $languages[]=$ln; |
|
227 | - } |
|
228 | - } |
|
219 | + // put appropriate languages into appropriate arrays, to print them sorted |
|
220 | + // used language -> common languages -> divider -> other languages |
|
221 | + if ($lang === $userLang) { |
|
222 | + $userLang = $ln; |
|
223 | + } elseif (in_array($lang, self::COMMON_LANGUAGE_CODES)) { |
|
224 | + $commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES)]=$ln; |
|
225 | + } else { |
|
226 | + $languages[]=$ln; |
|
227 | + } |
|
228 | + } |
|
229 | 229 | |
230 | - // if user language is not available but set somehow: show the actual code as name |
|
231 | - if (!is_array($userLang)) { |
|
232 | - $userLang = [ |
|
233 | - 'code' => $userLang, |
|
234 | - 'name' => $userLang, |
|
235 | - ]; |
|
236 | - } |
|
230 | + // if user language is not available but set somehow: show the actual code as name |
|
231 | + if (!is_array($userLang)) { |
|
232 | + $userLang = [ |
|
233 | + 'code' => $userLang, |
|
234 | + 'name' => $userLang, |
|
235 | + ]; |
|
236 | + } |
|
237 | 237 | |
238 | - ksort($commonLanguages); |
|
238 | + ksort($commonLanguages); |
|
239 | 239 | |
240 | - // sort now by displayed language not the iso-code |
|
241 | - usort( $languages, function ($a, $b) { |
|
242 | - if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { |
|
243 | - // If a doesn't have a name, but b does, list b before a |
|
244 | - return 1; |
|
245 | - } |
|
246 | - if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) { |
|
247 | - // If a does have a name, but b doesn't, list a before b |
|
248 | - return -1; |
|
249 | - } |
|
250 | - // Otherwise compare the names |
|
251 | - return strcmp($a['name'], $b['name']); |
|
252 | - }); |
|
240 | + // sort now by displayed language not the iso-code |
|
241 | + usort( $languages, function ($a, $b) { |
|
242 | + if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { |
|
243 | + // If a doesn't have a name, but b does, list b before a |
|
244 | + return 1; |
|
245 | + } |
|
246 | + if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) { |
|
247 | + // If a does have a name, but b doesn't, list a before b |
|
248 | + return -1; |
|
249 | + } |
|
250 | + // Otherwise compare the names |
|
251 | + return strcmp($a['name'], $b['name']); |
|
252 | + }); |
|
253 | 253 | |
254 | - return [ |
|
255 | - 'activelanguage' => $userLang, |
|
256 | - 'commonlanguages' => $commonLanguages, |
|
257 | - 'languages' => $languages |
|
258 | - ]; |
|
259 | - } |
|
254 | + return [ |
|
255 | + 'activelanguage' => $userLang, |
|
256 | + 'commonlanguages' => $commonLanguages, |
|
257 | + 'languages' => $languages |
|
258 | + ]; |
|
259 | + } |
|
260 | 260 | |
261 | - /** |
|
262 | - * @param array $userData |
|
263 | - * @return array |
|
264 | - */ |
|
265 | - private function getMessageParameters(array $userData) { |
|
266 | - $needVerifyMessage = [AccountManager::PROPERTY_EMAIL, AccountManager::PROPERTY_WEBSITE, AccountManager::PROPERTY_TWITTER]; |
|
267 | - $messageParameters = []; |
|
268 | - foreach ($needVerifyMessage as $property) { |
|
269 | - switch ($userData[$property]['verified']) { |
|
270 | - case AccountManager::VERIFIED: |
|
271 | - $message = $this->l->t('Verifying'); |
|
272 | - break; |
|
273 | - case AccountManager::VERIFICATION_IN_PROGRESS: |
|
274 | - $message = $this->l->t('Verifying …'); |
|
275 | - break; |
|
276 | - default: |
|
277 | - $message = $this->l->t('Verify'); |
|
278 | - } |
|
279 | - $messageParameters[$property . 'Message'] = $message; |
|
280 | - } |
|
281 | - return $messageParameters; |
|
282 | - } |
|
261 | + /** |
|
262 | + * @param array $userData |
|
263 | + * @return array |
|
264 | + */ |
|
265 | + private function getMessageParameters(array $userData) { |
|
266 | + $needVerifyMessage = [AccountManager::PROPERTY_EMAIL, AccountManager::PROPERTY_WEBSITE, AccountManager::PROPERTY_TWITTER]; |
|
267 | + $messageParameters = []; |
|
268 | + foreach ($needVerifyMessage as $property) { |
|
269 | + switch ($userData[$property]['verified']) { |
|
270 | + case AccountManager::VERIFIED: |
|
271 | + $message = $this->l->t('Verifying'); |
|
272 | + break; |
|
273 | + case AccountManager::VERIFICATION_IN_PROGRESS: |
|
274 | + $message = $this->l->t('Verifying …'); |
|
275 | + break; |
|
276 | + default: |
|
277 | + $message = $this->l->t('Verify'); |
|
278 | + } |
|
279 | + $messageParameters[$property . 'Message'] = $message; |
|
280 | + } |
|
281 | + return $messageParameters; |
|
282 | + } |
|
283 | 283 | |
284 | 284 | } |
@@ -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 85; |
|
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 85; |
|
81 | + } |
|
82 | 82 | } |