@@ -39,262 +39,262 @@ |
||
39 | 39 | * @since 6.0.0 |
40 | 40 | */ |
41 | 41 | interface IManager { |
42 | - /** |
|
43 | - * Generates a new IEvent object |
|
44 | - * |
|
45 | - * Make sure to call at least the following methods before sending it to the |
|
46 | - * app with via the publish() method: |
|
47 | - * - setApp() |
|
48 | - * - setType() |
|
49 | - * - setAffectedUser() |
|
50 | - * - setSubject() |
|
51 | - * |
|
52 | - * @return IEvent |
|
53 | - * @since 8.2.0 |
|
54 | - */ |
|
55 | - public function generateEvent(); |
|
56 | - |
|
57 | - /** |
|
58 | - * Publish an event to the activity consumers |
|
59 | - * |
|
60 | - * Make sure to call at least the following methods before sending an Event: |
|
61 | - * - setApp() |
|
62 | - * - setType() |
|
63 | - * - setAffectedUser() |
|
64 | - * - setSubject() |
|
65 | - * |
|
66 | - * @param IEvent $event |
|
67 | - * @throws \BadMethodCallException if required values have not been set |
|
68 | - * @since 8.2.0 |
|
69 | - */ |
|
70 | - public function publish(IEvent $event); |
|
71 | - |
|
72 | - /** |
|
73 | - * @param string $app The app where this event is associated with |
|
74 | - * @param string $subject A short description of the event |
|
75 | - * @param array $subjectParams Array with parameters that are filled in the subject |
|
76 | - * @param string $message A longer description of the event |
|
77 | - * @param array $messageParams Array with parameters that are filled in the message |
|
78 | - * @param string $file The file including path where this event is associated with |
|
79 | - * @param string $link A link where this event is associated with |
|
80 | - * @param string $affectedUser Recipient of the activity |
|
81 | - * @param string $type Type of the notification |
|
82 | - * @param int $priority Priority of the notification |
|
83 | - * @since 6.0.0 |
|
84 | - * @deprecated 8.2.0 Grab an IEvent from generateEvent() instead and use the publish() method |
|
85 | - */ |
|
86 | - public function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority); |
|
87 | - |
|
88 | - /** |
|
89 | - * In order to improve lazy loading a closure can be registered which will be called in case |
|
90 | - * activity consumers are actually requested |
|
91 | - * |
|
92 | - * $callable has to return an instance of \OCP\Activity\IConsumer |
|
93 | - * |
|
94 | - * @param \Closure $callable |
|
95 | - * @return void |
|
96 | - * @since 6.0.0 |
|
97 | - */ |
|
98 | - public function registerConsumer(\Closure $callable); |
|
99 | - |
|
100 | - /** |
|
101 | - * In order to improve lazy loading a closure can be registered which will be called in case |
|
102 | - * activity consumers are actually requested |
|
103 | - * |
|
104 | - * $callable has to return an instance of \OCP\Activity\IExtension |
|
105 | - * |
|
106 | - * @param \Closure $callable |
|
107 | - * @return void |
|
108 | - * @since 8.0.0 |
|
109 | - */ |
|
110 | - public function registerExtension(\Closure $callable); |
|
111 | - |
|
112 | - /** |
|
113 | - * @param string $filter Class must implement OCA\Activity\IFilter |
|
114 | - * @return void |
|
115 | - * @since 11.0.0 |
|
116 | - */ |
|
117 | - public function registerFilter($filter); |
|
118 | - |
|
119 | - /** |
|
120 | - * @return IFilter[] |
|
121 | - * @since 11.0.0 |
|
122 | - */ |
|
123 | - public function getFilters(); |
|
124 | - |
|
125 | - /** |
|
126 | - * @param string $id |
|
127 | - * @return IFilter |
|
128 | - * @throws \InvalidArgumentException when the filter was not found |
|
129 | - * @since 11.0.0 |
|
130 | - */ |
|
131 | - public function getFilterById($id); |
|
132 | - |
|
133 | - /** |
|
134 | - * @param string $setting Class must implement OCA\Activity\ISetting |
|
135 | - * @return void |
|
136 | - * @since 11.0.0 |
|
137 | - */ |
|
138 | - public function registerSetting($setting); |
|
139 | - |
|
140 | - /** |
|
141 | - * @return ISetting[] |
|
142 | - * @since 11.0.0 |
|
143 | - */ |
|
144 | - public function getSettings(); |
|
145 | - |
|
146 | - /** |
|
147 | - * @param string $provider Class must implement OCA\Activity\IProvider |
|
148 | - * @return void |
|
149 | - * @since 11.0.0 |
|
150 | - */ |
|
151 | - public function registerProvider($provider); |
|
152 | - |
|
153 | - /** |
|
154 | - * @return IProvider[] |
|
155 | - * @since 11.0.0 |
|
156 | - */ |
|
157 | - public function getProviders(); |
|
158 | - |
|
159 | - /** |
|
160 | - * @param string $id |
|
161 | - * @return ISetting |
|
162 | - * @throws \InvalidArgumentException when the setting was not found |
|
163 | - * @since 11.0.0 |
|
164 | - */ |
|
165 | - public function getSettingById($id); |
|
166 | - |
|
167 | - /** |
|
168 | - * Will return additional notification types as specified by other apps |
|
169 | - * |
|
170 | - * @param string $languageCode |
|
171 | - * @return array Array "stringID of the type" => "translated string description for the setting" |
|
172 | - * or Array "stringID of the type" => [ |
|
173 | - * 'desc' => "translated string description for the setting" |
|
174 | - * 'methods' => [\OCP\Activity\IExtension::METHOD_*], |
|
175 | - * ] |
|
176 | - * @since 8.0.0 - 8.2.0: Added support to allow limiting notifications to certain methods |
|
177 | - * @deprecated 11.0.0 - Use getSettings() instead |
|
178 | - */ |
|
179 | - public function getNotificationTypes($languageCode); |
|
180 | - |
|
181 | - /** |
|
182 | - * @param string $method |
|
183 | - * @return array |
|
184 | - * @since 8.0.0 |
|
185 | - * @deprecated 11.0.0 - Use getSettings()->isDefaulEnabled<method>() instead |
|
186 | - */ |
|
187 | - public function getDefaultTypes($method); |
|
188 | - |
|
189 | - /** |
|
190 | - * @param string $type |
|
191 | - * @return string |
|
192 | - * @since 8.0.0 |
|
193 | - */ |
|
194 | - public function getTypeIcon($type); |
|
195 | - |
|
196 | - /** |
|
197 | - * @param string $type |
|
198 | - * @param int $id |
|
199 | - * @since 8.2.0 |
|
200 | - */ |
|
201 | - public function setFormattingObject($type, $id); |
|
202 | - |
|
203 | - /** |
|
204 | - * @return bool |
|
205 | - * @since 8.2.0 |
|
206 | - */ |
|
207 | - public function isFormattingFilteredObject(); |
|
208 | - |
|
209 | - /** |
|
210 | - * @param bool $status Set to true, when parsing events should not use SVG icons |
|
211 | - * @since 12.0.1 |
|
212 | - */ |
|
213 | - public function setRequirePNG($status); |
|
214 | - |
|
215 | - /** |
|
216 | - * @return bool |
|
217 | - * @since 12.0.1 |
|
218 | - */ |
|
219 | - public function getRequirePNG(); |
|
220 | - |
|
221 | - /** |
|
222 | - * @param string $app |
|
223 | - * @param string $text |
|
224 | - * @param array $params |
|
225 | - * @param boolean $stripPath |
|
226 | - * @param boolean $highlightParams |
|
227 | - * @param string $languageCode |
|
228 | - * @return string|false |
|
229 | - * @since 8.0.0 |
|
230 | - */ |
|
231 | - public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode); |
|
232 | - |
|
233 | - /** |
|
234 | - * @param string $app |
|
235 | - * @param string $text |
|
236 | - * @return array|false |
|
237 | - * @since 8.0.0 |
|
238 | - */ |
|
239 | - public function getSpecialParameterList($app, $text); |
|
240 | - |
|
241 | - /** |
|
242 | - * @param array $activity |
|
243 | - * @return integer|false |
|
244 | - * @since 8.0.0 |
|
245 | - */ |
|
246 | - public function getGroupParameter($activity); |
|
247 | - |
|
248 | - |
|
249 | - /** |
|
250 | - * Set the user we need to use |
|
251 | - * |
|
252 | - * @param string|null $currentUserId |
|
253 | - * @throws \UnexpectedValueException If the user is invalid |
|
254 | - * @since 9.0.1 |
|
255 | - */ |
|
256 | - public function setCurrentUserId($currentUserId); |
|
257 | - |
|
258 | - /** |
|
259 | - * Get the user we need to use |
|
260 | - * |
|
261 | - * Either the user is logged in, or we try to get it from the token |
|
262 | - * |
|
263 | - * @return string |
|
264 | - * @throws \UnexpectedValueException If the token is invalid, does not exist or is not unique |
|
265 | - * @since 8.1.0 |
|
266 | - */ |
|
267 | - public function getCurrentUserId(); |
|
268 | - |
|
269 | - /** |
|
270 | - * @return array |
|
271 | - * @since 8.0.0 |
|
272 | - * @deprecated 11.0.0 - Use getFilters() instead |
|
273 | - */ |
|
274 | - public function getNavigation(); |
|
275 | - |
|
276 | - /** |
|
277 | - * @param string $filterValue |
|
278 | - * @return boolean |
|
279 | - * @since 8.0.0 |
|
280 | - * @deprecated 11.0.0 - Use getFilterById() instead |
|
281 | - */ |
|
282 | - public function isFilterValid($filterValue); |
|
283 | - |
|
284 | - /** |
|
285 | - * @param array $types |
|
286 | - * @param string $filter |
|
287 | - * @return array |
|
288 | - * @since 8.0.0 |
|
289 | - * @deprecated 11.0.0 - Use getFilterById()->filterTypes() instead |
|
290 | - */ |
|
291 | - public function filterNotificationTypes($types, $filter); |
|
292 | - |
|
293 | - /** |
|
294 | - * @param string $filter |
|
295 | - * @return array |
|
296 | - * @since 8.0.0 |
|
297 | - * @deprecated 11.0.0 - Use getFilterById() instead |
|
298 | - */ |
|
299 | - public function getQueryForFilter($filter); |
|
42 | + /** |
|
43 | + * Generates a new IEvent object |
|
44 | + * |
|
45 | + * Make sure to call at least the following methods before sending it to the |
|
46 | + * app with via the publish() method: |
|
47 | + * - setApp() |
|
48 | + * - setType() |
|
49 | + * - setAffectedUser() |
|
50 | + * - setSubject() |
|
51 | + * |
|
52 | + * @return IEvent |
|
53 | + * @since 8.2.0 |
|
54 | + */ |
|
55 | + public function generateEvent(); |
|
56 | + |
|
57 | + /** |
|
58 | + * Publish an event to the activity consumers |
|
59 | + * |
|
60 | + * Make sure to call at least the following methods before sending an Event: |
|
61 | + * - setApp() |
|
62 | + * - setType() |
|
63 | + * - setAffectedUser() |
|
64 | + * - setSubject() |
|
65 | + * |
|
66 | + * @param IEvent $event |
|
67 | + * @throws \BadMethodCallException if required values have not been set |
|
68 | + * @since 8.2.0 |
|
69 | + */ |
|
70 | + public function publish(IEvent $event); |
|
71 | + |
|
72 | + /** |
|
73 | + * @param string $app The app where this event is associated with |
|
74 | + * @param string $subject A short description of the event |
|
75 | + * @param array $subjectParams Array with parameters that are filled in the subject |
|
76 | + * @param string $message A longer description of the event |
|
77 | + * @param array $messageParams Array with parameters that are filled in the message |
|
78 | + * @param string $file The file including path where this event is associated with |
|
79 | + * @param string $link A link where this event is associated with |
|
80 | + * @param string $affectedUser Recipient of the activity |
|
81 | + * @param string $type Type of the notification |
|
82 | + * @param int $priority Priority of the notification |
|
83 | + * @since 6.0.0 |
|
84 | + * @deprecated 8.2.0 Grab an IEvent from generateEvent() instead and use the publish() method |
|
85 | + */ |
|
86 | + public function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority); |
|
87 | + |
|
88 | + /** |
|
89 | + * In order to improve lazy loading a closure can be registered which will be called in case |
|
90 | + * activity consumers are actually requested |
|
91 | + * |
|
92 | + * $callable has to return an instance of \OCP\Activity\IConsumer |
|
93 | + * |
|
94 | + * @param \Closure $callable |
|
95 | + * @return void |
|
96 | + * @since 6.0.0 |
|
97 | + */ |
|
98 | + public function registerConsumer(\Closure $callable); |
|
99 | + |
|
100 | + /** |
|
101 | + * In order to improve lazy loading a closure can be registered which will be called in case |
|
102 | + * activity consumers are actually requested |
|
103 | + * |
|
104 | + * $callable has to return an instance of \OCP\Activity\IExtension |
|
105 | + * |
|
106 | + * @param \Closure $callable |
|
107 | + * @return void |
|
108 | + * @since 8.0.0 |
|
109 | + */ |
|
110 | + public function registerExtension(\Closure $callable); |
|
111 | + |
|
112 | + /** |
|
113 | + * @param string $filter Class must implement OCA\Activity\IFilter |
|
114 | + * @return void |
|
115 | + * @since 11.0.0 |
|
116 | + */ |
|
117 | + public function registerFilter($filter); |
|
118 | + |
|
119 | + /** |
|
120 | + * @return IFilter[] |
|
121 | + * @since 11.0.0 |
|
122 | + */ |
|
123 | + public function getFilters(); |
|
124 | + |
|
125 | + /** |
|
126 | + * @param string $id |
|
127 | + * @return IFilter |
|
128 | + * @throws \InvalidArgumentException when the filter was not found |
|
129 | + * @since 11.0.0 |
|
130 | + */ |
|
131 | + public function getFilterById($id); |
|
132 | + |
|
133 | + /** |
|
134 | + * @param string $setting Class must implement OCA\Activity\ISetting |
|
135 | + * @return void |
|
136 | + * @since 11.0.0 |
|
137 | + */ |
|
138 | + public function registerSetting($setting); |
|
139 | + |
|
140 | + /** |
|
141 | + * @return ISetting[] |
|
142 | + * @since 11.0.0 |
|
143 | + */ |
|
144 | + public function getSettings(); |
|
145 | + |
|
146 | + /** |
|
147 | + * @param string $provider Class must implement OCA\Activity\IProvider |
|
148 | + * @return void |
|
149 | + * @since 11.0.0 |
|
150 | + */ |
|
151 | + public function registerProvider($provider); |
|
152 | + |
|
153 | + /** |
|
154 | + * @return IProvider[] |
|
155 | + * @since 11.0.0 |
|
156 | + */ |
|
157 | + public function getProviders(); |
|
158 | + |
|
159 | + /** |
|
160 | + * @param string $id |
|
161 | + * @return ISetting |
|
162 | + * @throws \InvalidArgumentException when the setting was not found |
|
163 | + * @since 11.0.0 |
|
164 | + */ |
|
165 | + public function getSettingById($id); |
|
166 | + |
|
167 | + /** |
|
168 | + * Will return additional notification types as specified by other apps |
|
169 | + * |
|
170 | + * @param string $languageCode |
|
171 | + * @return array Array "stringID of the type" => "translated string description for the setting" |
|
172 | + * or Array "stringID of the type" => [ |
|
173 | + * 'desc' => "translated string description for the setting" |
|
174 | + * 'methods' => [\OCP\Activity\IExtension::METHOD_*], |
|
175 | + * ] |
|
176 | + * @since 8.0.0 - 8.2.0: Added support to allow limiting notifications to certain methods |
|
177 | + * @deprecated 11.0.0 - Use getSettings() instead |
|
178 | + */ |
|
179 | + public function getNotificationTypes($languageCode); |
|
180 | + |
|
181 | + /** |
|
182 | + * @param string $method |
|
183 | + * @return array |
|
184 | + * @since 8.0.0 |
|
185 | + * @deprecated 11.0.0 - Use getSettings()->isDefaulEnabled<method>() instead |
|
186 | + */ |
|
187 | + public function getDefaultTypes($method); |
|
188 | + |
|
189 | + /** |
|
190 | + * @param string $type |
|
191 | + * @return string |
|
192 | + * @since 8.0.0 |
|
193 | + */ |
|
194 | + public function getTypeIcon($type); |
|
195 | + |
|
196 | + /** |
|
197 | + * @param string $type |
|
198 | + * @param int $id |
|
199 | + * @since 8.2.0 |
|
200 | + */ |
|
201 | + public function setFormattingObject($type, $id); |
|
202 | + |
|
203 | + /** |
|
204 | + * @return bool |
|
205 | + * @since 8.2.0 |
|
206 | + */ |
|
207 | + public function isFormattingFilteredObject(); |
|
208 | + |
|
209 | + /** |
|
210 | + * @param bool $status Set to true, when parsing events should not use SVG icons |
|
211 | + * @since 12.0.1 |
|
212 | + */ |
|
213 | + public function setRequirePNG($status); |
|
214 | + |
|
215 | + /** |
|
216 | + * @return bool |
|
217 | + * @since 12.0.1 |
|
218 | + */ |
|
219 | + public function getRequirePNG(); |
|
220 | + |
|
221 | + /** |
|
222 | + * @param string $app |
|
223 | + * @param string $text |
|
224 | + * @param array $params |
|
225 | + * @param boolean $stripPath |
|
226 | + * @param boolean $highlightParams |
|
227 | + * @param string $languageCode |
|
228 | + * @return string|false |
|
229 | + * @since 8.0.0 |
|
230 | + */ |
|
231 | + public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode); |
|
232 | + |
|
233 | + /** |
|
234 | + * @param string $app |
|
235 | + * @param string $text |
|
236 | + * @return array|false |
|
237 | + * @since 8.0.0 |
|
238 | + */ |
|
239 | + public function getSpecialParameterList($app, $text); |
|
240 | + |
|
241 | + /** |
|
242 | + * @param array $activity |
|
243 | + * @return integer|false |
|
244 | + * @since 8.0.0 |
|
245 | + */ |
|
246 | + public function getGroupParameter($activity); |
|
247 | + |
|
248 | + |
|
249 | + /** |
|
250 | + * Set the user we need to use |
|
251 | + * |
|
252 | + * @param string|null $currentUserId |
|
253 | + * @throws \UnexpectedValueException If the user is invalid |
|
254 | + * @since 9.0.1 |
|
255 | + */ |
|
256 | + public function setCurrentUserId($currentUserId); |
|
257 | + |
|
258 | + /** |
|
259 | + * Get the user we need to use |
|
260 | + * |
|
261 | + * Either the user is logged in, or we try to get it from the token |
|
262 | + * |
|
263 | + * @return string |
|
264 | + * @throws \UnexpectedValueException If the token is invalid, does not exist or is not unique |
|
265 | + * @since 8.1.0 |
|
266 | + */ |
|
267 | + public function getCurrentUserId(); |
|
268 | + |
|
269 | + /** |
|
270 | + * @return array |
|
271 | + * @since 8.0.0 |
|
272 | + * @deprecated 11.0.0 - Use getFilters() instead |
|
273 | + */ |
|
274 | + public function getNavigation(); |
|
275 | + |
|
276 | + /** |
|
277 | + * @param string $filterValue |
|
278 | + * @return boolean |
|
279 | + * @since 8.0.0 |
|
280 | + * @deprecated 11.0.0 - Use getFilterById() instead |
|
281 | + */ |
|
282 | + public function isFilterValid($filterValue); |
|
283 | + |
|
284 | + /** |
|
285 | + * @param array $types |
|
286 | + * @param string $filter |
|
287 | + * @return array |
|
288 | + * @since 8.0.0 |
|
289 | + * @deprecated 11.0.0 - Use getFilterById()->filterTypes() instead |
|
290 | + */ |
|
291 | + public function filterNotificationTypes($types, $filter); |
|
292 | + |
|
293 | + /** |
|
294 | + * @param string $filter |
|
295 | + * @return array |
|
296 | + * @since 8.0.0 |
|
297 | + * @deprecated 11.0.0 - Use getFilterById() instead |
|
298 | + */ |
|
299 | + public function getQueryForFilter($filter); |
|
300 | 300 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | public function getForm() { |
66 | 66 | $cloudID = $this->userSession->getUser()->getCloudId(); |
67 | - $url = 'https://nextcloud.com/federation#' . $cloudID; |
|
67 | + $url = 'https://nextcloud.com/federation#'.$cloudID; |
|
68 | 68 | |
69 | 69 | $parameters = [ |
70 | 70 | 'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(), |
@@ -33,69 +33,69 @@ |
||
33 | 33 | |
34 | 34 | class Personal implements ISettings { |
35 | 35 | |
36 | - /** @var FederatedShareProvider */ |
|
37 | - private $federatedShareProvider; |
|
38 | - /** @var IUserSession */ |
|
39 | - private $userSession; |
|
40 | - /** @var IL10N */ |
|
41 | - private $l; |
|
42 | - /** @var IURLGenerator */ |
|
43 | - private $urlGenerator; |
|
44 | - /** @var \OC_Defaults */ |
|
45 | - private $defaults; |
|
36 | + /** @var FederatedShareProvider */ |
|
37 | + private $federatedShareProvider; |
|
38 | + /** @var IUserSession */ |
|
39 | + private $userSession; |
|
40 | + /** @var IL10N */ |
|
41 | + private $l; |
|
42 | + /** @var IURLGenerator */ |
|
43 | + private $urlGenerator; |
|
44 | + /** @var \OC_Defaults */ |
|
45 | + private $defaults; |
|
46 | 46 | |
47 | - public function __construct( |
|
48 | - FederatedShareProvider $federatedShareProvider, # |
|
49 | - IUserSession $userSession, |
|
50 | - IL10N $l, |
|
51 | - IURLGenerator $urlGenerator, |
|
52 | - \OC_Defaults $defaults |
|
53 | - ) { |
|
54 | - $this->federatedShareProvider = $federatedShareProvider; |
|
55 | - $this->userSession = $userSession; |
|
56 | - $this->l = $l; |
|
57 | - $this->urlGenerator = $urlGenerator; |
|
58 | - $this->defaults = $defaults; |
|
59 | - } |
|
47 | + public function __construct( |
|
48 | + FederatedShareProvider $federatedShareProvider, # |
|
49 | + IUserSession $userSession, |
|
50 | + IL10N $l, |
|
51 | + IURLGenerator $urlGenerator, |
|
52 | + \OC_Defaults $defaults |
|
53 | + ) { |
|
54 | + $this->federatedShareProvider = $federatedShareProvider; |
|
55 | + $this->userSession = $userSession; |
|
56 | + $this->l = $l; |
|
57 | + $this->urlGenerator = $urlGenerator; |
|
58 | + $this->defaults = $defaults; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
63 | - * @since 9.1 |
|
64 | - */ |
|
65 | - public function getForm() { |
|
66 | - $cloudID = $this->userSession->getUser()->getCloudId(); |
|
67 | - $url = 'https://nextcloud.com/federation#' . $cloudID; |
|
61 | + /** |
|
62 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
63 | + * @since 9.1 |
|
64 | + */ |
|
65 | + public function getForm() { |
|
66 | + $cloudID = $this->userSession->getUser()->getCloudId(); |
|
67 | + $url = 'https://nextcloud.com/federation#' . $cloudID; |
|
68 | 68 | |
69 | - $parameters = [ |
|
70 | - 'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(), |
|
71 | - 'message_with_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID, see %s', [$url]), |
|
72 | - 'message_without_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID', [$cloudID]), |
|
73 | - 'logoPath' => $this->urlGenerator->imagePath('core', 'logo.svg'), |
|
74 | - 'reference' => $url, |
|
75 | - 'cloudId' => $cloudID, |
|
76 | - 'color' => $this->defaults->getColorPrimary(), |
|
77 | - 'textColor' => "#ffffff", |
|
78 | - ]; |
|
79 | - return new TemplateResponse('federatedfilesharing', 'settings-personal', $parameters, ''); |
|
80 | - } |
|
69 | + $parameters = [ |
|
70 | + 'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(), |
|
71 | + 'message_with_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID, see %s', [$url]), |
|
72 | + 'message_without_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID', [$cloudID]), |
|
73 | + 'logoPath' => $this->urlGenerator->imagePath('core', 'logo.svg'), |
|
74 | + 'reference' => $url, |
|
75 | + 'cloudId' => $cloudID, |
|
76 | + 'color' => $this->defaults->getColorPrimary(), |
|
77 | + 'textColor' => "#ffffff", |
|
78 | + ]; |
|
79 | + return new TemplateResponse('federatedfilesharing', 'settings-personal', $parameters, ''); |
|
80 | + } |
|
81 | 81 | |
82 | - /** |
|
83 | - * @return string the section ID, e.g. 'sharing' |
|
84 | - * @since 9.1 |
|
85 | - */ |
|
86 | - public function getSection() { |
|
87 | - return 'sharing'; |
|
88 | - } |
|
82 | + /** |
|
83 | + * @return string the section ID, e.g. 'sharing' |
|
84 | + * @since 9.1 |
|
85 | + */ |
|
86 | + public function getSection() { |
|
87 | + return 'sharing'; |
|
88 | + } |
|
89 | 89 | |
90 | - /** |
|
91 | - * @return int whether the form should be rather on the top or bottom of |
|
92 | - * the admin section. The forms are arranged in ascending order of the |
|
93 | - * priority values. It is required to return a value between 0 and 100. |
|
94 | - * |
|
95 | - * E.g.: 70 |
|
96 | - * @since 9.1 |
|
97 | - */ |
|
98 | - public function getPriority() { |
|
99 | - return 40; |
|
100 | - } |
|
90 | + /** |
|
91 | + * @return int whether the form should be rather on the top or bottom of |
|
92 | + * the admin section. The forms are arranged in ascending order of the |
|
93 | + * priority values. It is required to return a value between 0 and 100. |
|
94 | + * |
|
95 | + * E.g.: 70 |
|
96 | + * @since 9.1 |
|
97 | + */ |
|
98 | + public function getPriority() { |
|
99 | + return 40; |
|
100 | + } |
|
101 | 101 | } |
@@ -21,5 +21,5 @@ |
||
21 | 21 | * |
22 | 22 | */ |
23 | 23 | |
24 | - # used for Personal/Additional settings as fallback for legacy settings |
|
24 | + # used for Personal/Additional settings as fallback for legacy settings |
|
25 | 25 | ?> |
@@ -29,58 +29,58 @@ |
||
29 | 29 | use OCP\Settings\IIconSection; |
30 | 30 | |
31 | 31 | class PersonalSection implements IIconSection { |
32 | - /** @var IURLGenerator */ |
|
33 | - private $urlGenerator; |
|
34 | - /** @var IL10N */ |
|
35 | - private $l; |
|
32 | + /** @var IURLGenerator */ |
|
33 | + private $urlGenerator; |
|
34 | + /** @var IL10N */ |
|
35 | + private $l; |
|
36 | 36 | |
37 | - public function __construct(IURLGenerator $urlGenerator, IL10N $l) { |
|
38 | - $this->urlGenerator = $urlGenerator; |
|
39 | - $this->l = $l; |
|
40 | - } |
|
37 | + public function __construct(IURLGenerator $urlGenerator, IL10N $l) { |
|
38 | + $this->urlGenerator = $urlGenerator; |
|
39 | + $this->l = $l; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * returns the relative path to an 16*16 icon describing the section. |
|
44 | - * e.g. '/core/img/places/files.svg' |
|
45 | - * |
|
46 | - * @returns string |
|
47 | - * @since 13.0.0 |
|
48 | - */ |
|
49 | - public function getIcon() { |
|
50 | - return $this->urlGenerator->imagePath('core', 'actions/share.svg'); |
|
51 | - } |
|
42 | + /** |
|
43 | + * returns the relative path to an 16*16 icon describing the section. |
|
44 | + * e.g. '/core/img/places/files.svg' |
|
45 | + * |
|
46 | + * @returns string |
|
47 | + * @since 13.0.0 |
|
48 | + */ |
|
49 | + public function getIcon() { |
|
50 | + return $this->urlGenerator->imagePath('core', 'actions/share.svg'); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * returns the ID of the section. It is supposed to be a lower case string, |
|
55 | - * e.g. 'ldap' |
|
56 | - * |
|
57 | - * @returns string |
|
58 | - * @since 9.1 |
|
59 | - */ |
|
60 | - public function getID() { |
|
61 | - return 'sharing'; |
|
62 | - } |
|
53 | + /** |
|
54 | + * returns the ID of the section. It is supposed to be a lower case string, |
|
55 | + * e.g. 'ldap' |
|
56 | + * |
|
57 | + * @returns string |
|
58 | + * @since 9.1 |
|
59 | + */ |
|
60 | + public function getID() { |
|
61 | + return 'sharing'; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * returns the translated name as it should be displayed, e.g. 'LDAP / AD |
|
66 | - * integration'. Use the L10N service to translate it. |
|
67 | - * |
|
68 | - * @return string |
|
69 | - * @since 9.1 |
|
70 | - */ |
|
71 | - public function getName() { |
|
72 | - return $this->l->t('Sharing'); |
|
73 | - } |
|
64 | + /** |
|
65 | + * returns the translated name as it should be displayed, e.g. 'LDAP / AD |
|
66 | + * integration'. Use the L10N service to translate it. |
|
67 | + * |
|
68 | + * @return string |
|
69 | + * @since 9.1 |
|
70 | + */ |
|
71 | + public function getName() { |
|
72 | + return $this->l->t('Sharing'); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @return int whether the form should be rather on the top or bottom of |
|
77 | - * the settings navigation. The sections are arranged in ascending order of |
|
78 | - * the priority values. It is required to return a value between 0 and 99. |
|
79 | - * |
|
80 | - * E.g.: 70 |
|
81 | - * @since 9.1 |
|
82 | - */ |
|
83 | - public function getPriority() { |
|
84 | - return 15; |
|
85 | - } |
|
75 | + /** |
|
76 | + * @return int whether the form should be rather on the top or bottom of |
|
77 | + * the settings navigation. The sections are arranged in ascending order of |
|
78 | + * the priority values. It is required to return a value between 0 and 99. |
|
79 | + * |
|
80 | + * E.g.: 70 |
|
81 | + * @since 9.1 |
|
82 | + */ |
|
83 | + public function getPriority() { |
|
84 | + return 15; |
|
85 | + } |
|
86 | 86 | } |
@@ -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 | } |
@@ -72,11 +72,17 @@ discard block |
||
72 | 72 | </select> |
73 | 73 | |
74 | 74 | <label id="mail_smtpsecure_label" for="mail_smtpsecure" |
75 | - <?php if ($_['mail_smtpmode'] !== 'smtp') print_unescaped(' class="hidden"'); ?>> |
|
75 | + <?php if ($_['mail_smtpmode'] !== 'smtp') { |
|
76 | + print_unescaped(' class="hidden"'); |
|
77 | +} |
|
78 | +?>> |
|
76 | 79 | <?php p($l->t('Encryption')); ?> |
77 | 80 | </label> |
78 | 81 | <select name="mail_smtpsecure" id="mail_smtpsecure" |
79 | - <?php if ($_['mail_smtpmode'] !== 'smtp') print_unescaped(' class="hidden"'); ?>> |
|
82 | + <?php if ($_['mail_smtpmode'] !== 'smtp') { |
|
83 | + print_unescaped(' class="hidden"'); |
|
84 | +} |
|
85 | +?>> |
|
80 | 86 | <?php foreach ($mail_smtpsecure as $secure => $name): |
81 | 87 | $selected = ''; |
82 | 88 | if ($secure == $_['mail_smtpsecure']): |
@@ -95,7 +101,10 @@ discard block |
||
95 | 101 | value="<?php p($_['mail_domain']) ?>" /> |
96 | 102 | </p> |
97 | 103 | |
98 | - <p id="setting_smtpauth" <?php if ($_['mail_smtpmode'] !== 'smtp') print_unescaped(' class="hidden"'); ?>> |
|
104 | + <p id="setting_smtpauth" <?php if ($_['mail_smtpmode'] !== 'smtp') { |
|
105 | + print_unescaped(' class="hidden"'); |
|
106 | +} |
|
107 | +?>> |
|
99 | 108 | <label for="mail_smtpauthtype"><?php p($l->t('Authentication method')); ?></label> |
100 | 109 | <select name="mail_smtpauthtype" id="mail_smtpauthtype'> |
101 | 110 | <?php foreach ($mail_smtpauthtype as $authtype => $name): |
@@ -108,11 +117,17 @@ discard block |
||
108 | 117 | </select> |
109 | 118 | |
110 | 119 | <input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" class="checkbox" value="1" |
111 | - <?php if ($_['mail_smtpauth']) print_unescaped('checked="checked"'); ?> /> |
|
120 | + <?php if ($_['mail_smtpauth']) { |
|
121 | + print_unescaped('checked="checked"'); |
|
122 | +} |
|
123 | +?> /> |
|
112 | 124 | <label for="mail_smtpauth"><?php p($l->t('Authentication required')); ?></label> |
113 | 125 | </p> |
114 | 126 | |
115 | - <p id="setting_smtphost" <?php if ($_['mail_smtpmode'] !== 'smtp') print_unescaped(' class="hidden"'); ?>> |
|
127 | + <p id="setting_smtphost" <?php if ($_['mail_smtpmode'] !== 'smtp') { |
|
128 | + print_unescaped(' class="hidden"'); |
|
129 | +} |
|
130 | +?>> |
|
116 | 131 | <label for="mail_smtphost"><?php p($l->t('Server address')); ?></label> |
117 | 132 | <input type="text" name="mail_smtphost" id="mail_smtphost" placeholder="smtp.example.com" |
118 | 133 | value="<?php p($_['mail_smtphost']) ?>" /> |
@@ -122,7 +137,10 @@ discard block |
||
122 | 137 | </p> |
123 | 138 | </form> |
124 | 139 | <form class="mail_settings" id="mail_credentials_settings"> |
125 | - <p id="mail_credentials" <?php if (!$_['mail_smtpauth'] || $_['mail_smtpmode'] !== 'smtp') print_unescaped(' class="hidden"'); ?>> |
|
140 | + <p id="mail_credentials" <?php if (!$_['mail_smtpauth'] || $_['mail_smtpmode'] !== 'smtp') { |
|
141 | + print_unescaped(' class="hidden"'); |
|
142 | +} |
|
143 | +?>> |
|
126 | 144 | <label for="mail_smtpname"><?php p($l->t('Credentials')); ?></label> |
127 | 145 | <input type="text" name="mail_smtpname" id="mail_smtpname" placeholder="<?php p($l->t('SMTP Username'))?>" |
128 | 146 | value="<?php p($_['mail_smtpname']) ?>" /> |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | |
53 | 53 | <div class="section" id="mail_general_settings"> |
54 | 54 | <form id="mail_general_settings_form" class="mail_settings"> |
55 | - <h2><?php p($l->t('Email server'));?></h2> |
|
55 | + <h2><?php p($l->t('Email server')); ?></h2> |
|
56 | 56 | <a target="_blank" rel="noreferrer noopener" class="icon-info" |
57 | - title="<?php p($l->t('Open documentation'));?>" |
|
57 | + title="<?php p($l->t('Open documentation')); ?>" |
|
58 | 58 | href="<?php p(link_to_docs('admin-email')); ?>"></a> |
59 | 59 | <p class="settings-hint"><?php p($l->t('It is important to set up this server to be able to send emails, like for password reset and notifications.')); ?></p> |
60 | 60 | <p><span id="mail_settings_msg" class="msg"></span></p> |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $selected = 'selected="selected"'; |
69 | 69 | endif; ?> |
70 | 70 | <option value="<?php p($smtpmode[0])?>" <?php p($selected) ?>><?php p($smtpmode[1]) ?></option> |
71 | - <?php endforeach;?> |
|
71 | + <?php endforeach; ?> |
|
72 | 72 | </select> |
73 | 73 | |
74 | 74 | <label id="mail_smtpsecure_label" for="mail_smtpsecure" |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $selected = 'selected="selected"'; |
84 | 84 | endif; ?> |
85 | 85 | <option value="<?php p($secure)?>" <?php p($selected) ?>><?php p($name) ?></option> |
86 | - <?php endforeach;?> |
|
86 | + <?php endforeach; ?> |
|
87 | 87 | </select> |
88 | 88 | </p> |
89 | 89 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $selected = 'selected="selected"'; |
105 | 105 | endif; ?> |
106 | 106 | <option value="<?php p($authtype)?>" <?php p($selected) ?>><?php p($name) ?></option> |
107 | - <?php endforeach;?> |
|
107 | + <?php endforeach; ?> |
|
108 | 108 | </select> |
109 | 109 | |
110 | 110 | <input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" class="checkbox" value="1" |
@@ -25,26 +25,26 @@ discard block |
||
25 | 25 | /** @var array $_ */ |
26 | 26 | |
27 | 27 | $mail_smtpauthtype = [ |
28 | - '' => $l->t('None'), |
|
29 | - 'LOGIN' => $l->t('Login'), |
|
30 | - 'PLAIN' => $l->t('Plain'), |
|
31 | - 'NTLM' => $l->t('NT LAN Manager'), |
|
28 | + '' => $l->t('None'), |
|
29 | + 'LOGIN' => $l->t('Login'), |
|
30 | + 'PLAIN' => $l->t('Plain'), |
|
31 | + 'NTLM' => $l->t('NT LAN Manager'), |
|
32 | 32 | ]; |
33 | 33 | |
34 | 34 | $mail_smtpsecure = [ |
35 | - '' => $l->t('None'), |
|
36 | - 'ssl' => $l->t('SSL/TLS'), |
|
37 | - 'tls' => $l->t('STARTTLS'), |
|
35 | + '' => $l->t('None'), |
|
36 | + 'ssl' => $l->t('SSL/TLS'), |
|
37 | + 'tls' => $l->t('STARTTLS'), |
|
38 | 38 | ]; |
39 | 39 | |
40 | 40 | $mail_smtpmode = [ |
41 | - ['smtp', 'SMTP'], |
|
41 | + ['smtp', 'SMTP'], |
|
42 | 42 | ]; |
43 | 43 | if ($_['sendmail_is_available']) { |
44 | - $mail_smtpmode[] = ['sendmail', 'Sendmail']; |
|
44 | + $mail_smtpmode[] = ['sendmail', 'Sendmail']; |
|
45 | 45 | } |
46 | 46 | if ($_['mail_smtpmode'] === 'qmail') { |
47 | - $mail_smtpmode[] = ['qmail', 'qmail']; |
|
47 | + $mail_smtpmode[] = ['qmail', 'qmail']; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | ?> |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | <label for="mail_smtpmode"><?php p($l->t('Send mode')); ?></label> |
63 | 63 | <select name="mail_smtpmode" id="mail_smtpmode"> |
64 | 64 | <?php foreach ($mail_smtpmode as $smtpmode): |
65 | - $selected = ''; |
|
66 | - if ($smtpmode[0] == $_['mail_smtpmode']): |
|
67 | - $selected = 'selected="selected"'; |
|
68 | - endif; ?> |
|
65 | + $selected = ''; |
|
66 | + if ($smtpmode[0] == $_['mail_smtpmode']): |
|
67 | + $selected = 'selected="selected"'; |
|
68 | + endif; ?> |
|
69 | 69 | <option value="<?php p($smtpmode[0])?>" <?php p($selected) ?>><?php p($smtpmode[1]) ?></option> |
70 | 70 | <?php endforeach;?> |
71 | 71 | </select> |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | <select name="mail_smtpsecure" id="mail_smtpsecure" |
78 | 78 | <?php if ($_['mail_smtpmode'] !== 'smtp') print_unescaped(' class="hidden"'); ?>> |
79 | 79 | <?php foreach ($mail_smtpsecure as $secure => $name): |
80 | - $selected = ''; |
|
81 | - if ($secure == $_['mail_smtpsecure']): |
|
82 | - $selected = 'selected="selected"'; |
|
83 | - endif; ?> |
|
80 | + $selected = ''; |
|
81 | + if ($secure == $_['mail_smtpsecure']): |
|
82 | + $selected = 'selected="selected"'; |
|
83 | + endif; ?> |
|
84 | 84 | <option value="<?php p($secure)?>" <?php p($selected) ?>><?php p($name) ?></option> |
85 | 85 | <?php endforeach;?> |
86 | 86 | </select> |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | <label for="mail_smtpauthtype"><?php p($l->t('Authentication method')); ?></label> |
99 | 99 | <select name="mail_smtpauthtype" id="mail_smtpauthtype'> |
100 | 100 | <?php foreach ($mail_smtpauthtype as $authtype => $name): |
101 | - $selected = ''; |
|
102 | - if ($authtype == $_['mail_smtpauthtype']): |
|
103 | - $selected = 'selected="selected"'; |
|
104 | - endif; ?> |
|
101 | + $selected = ''; |
|
102 | + if ($authtype == $_['mail_smtpauthtype']): |
|
103 | + $selected = 'selected="selected"'; |
|
104 | + endif; ?> |
|
105 | 105 | <option value="<?php p($authtype)?>" <?php p($selected) ?>><?php p($name) ?></option> |
106 | 106 | <?php endforeach;?> |
107 | 107 | </select> |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | <div id="EncryptionSettingsArea" class="<?php if (!$_['encryptionEnabled']) p('hidden'); ?>"> |
58 | 58 | <div id='selectEncryptionModules' class="<?php if (!$_['encryptionReady']) p('hidden'); ?>"> |
59 | 59 | <?php |
60 | - if (empty($_['encryptionModules'])) { |
|
61 | - p($l->t('No encryption module loaded, please enable an encryption module in the app menu.')); |
|
62 | - } else { ?> |
|
60 | + if (empty($_['encryptionModules'])) { |
|
61 | + p($l->t('No encryption module loaded, please enable an encryption module in the app menu.')); |
|
62 | + } else { ?> |
|
63 | 63 | <h3><?php p($l->t('Select default encryption module:')) ?></h3> |
64 | 64 | <fieldset id='encryptionModules'> |
65 | 65 | <?php foreach ($_['encryptionModules'] as $id => $module): ?> |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | name="default_encryption_module" |
68 | 68 | value="<?php p($id) ?>" |
69 | 69 | <?php if ($module['default']) { |
70 | - p('checked'); |
|
71 | - } ?>> |
|
70 | + p('checked'); |
|
71 | + } ?>> |
|
72 | 72 | <label |
73 | 73 | for="<?php p($id) ?>"><?php p($module['displayName']) ?></label> |
74 | 74 | <br/> |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | </div> |
79 | 79 | <div id="migrationWarning" class="<?php if ($_['encryptionReady']) p('hidden'); ?>"> |
80 | 80 | <?php |
81 | - if ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === true) { |
|
82 | - p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the "Default encryption module" and run \'occ encryption:migrate\'')); |
|
83 | - } elseif ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === false) { |
|
84 | - p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one.')); ?> |
|
81 | + if ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === true) { |
|
82 | + p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the "Default encryption module" and run \'occ encryption:migrate\'')); |
|
83 | + } elseif ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === false) { |
|
84 | + p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one.')); ?> |
|
85 | 85 | <input type="submit" name="startmigration" id="startmigration" |
86 | 86 | value="<?php p($l->t('Start migration')); ?>"/> |
87 | 87 | <?php } ?> |
@@ -35,7 +35,10 @@ discard block |
||
35 | 35 | <p id="enable"> |
36 | 36 | <input type="checkbox" |
37 | 37 | id="enableEncryption" class="checkbox" |
38 | - value="1" <?php if ($_['encryptionEnabled']) print_unescaped('checked="checked" disabled="disabled"'); ?> /> |
|
38 | + value="1" <?php if ($_['encryptionEnabled']) { |
|
39 | + print_unescaped('checked="checked" disabled="disabled"'); |
|
40 | +} |
|
41 | +?> /> |
|
39 | 42 | <label |
40 | 43 | for="enableEncryption"><?php p($l->t('Enable server-side encryption')); ?> <span id="startmigration_msg" class="msg"></span> </label><br/> |
41 | 44 | </p> |
@@ -54,8 +57,14 @@ discard block |
||
54 | 57 | value="<?php p($l->t("Enable encryption")); ?>" /></p> |
55 | 58 | </div> |
56 | 59 | |
57 | - <div id="EncryptionSettingsArea" class="<?php if (!$_['encryptionEnabled']) p('hidden'); ?>"> |
|
58 | - <div id='selectEncryptionModules' class="<?php if (!$_['encryptionReady']) p('hidden'); ?>"> |
|
60 | + <div id="EncryptionSettingsArea" class="<?php if (!$_['encryptionEnabled']) { |
|
61 | + p('hidden'); |
|
62 | +} |
|
63 | +?>"> |
|
64 | + <div id='selectEncryptionModules' class="<?php if (!$_['encryptionReady']) { |
|
65 | + p('hidden'); |
|
66 | +} |
|
67 | +?>"> |
|
59 | 68 | <?php |
60 | 69 | if (empty($_['encryptionModules'])) { |
61 | 70 | p($l->t('No encryption module loaded, please enable an encryption module in the app menu.')); |
@@ -76,7 +85,10 @@ discard block |
||
76 | 85 | </fieldset> |
77 | 86 | <?php } ?> |
78 | 87 | </div> |
79 | - <div id="migrationWarning" class="<?php if ($_['encryptionReady']) p('hidden'); ?>"> |
|
88 | + <div id="migrationWarning" class="<?php if ($_['encryptionReady']) { |
|
89 | + p('hidden'); |
|
90 | +} |
|
91 | +?>"> |
|
80 | 92 | <?php |
81 | 93 | if ($_['encryptionReady'] === false && $_['externalBackendsEnabled'] === true) { |
82 | 94 | p($l->t('You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the "Default encryption module" and run \'occ encryption:migrate\'')); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | <div class="section" id='encryptionAPI'> |
30 | 30 | <h2><?php p($l->t('Server-side encryption')); ?></h2> |
31 | 31 | <a target="_blank" rel="noreferrer noopener" class="icon-info" |
32 | - title="<?php p($l->t('Open documentation'));?>" |
|
32 | + title="<?php p($l->t('Open documentation')); ?>" |
|
33 | 33 | href="<?php p(link_to_docs('admin-encryption')); ?>"></a> |
34 | 34 | <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> |
35 | 35 | <p id="enable"> |
@@ -69,7 +69,7 @@ |
||
69 | 69 | /** |
70 | 70 | * Generate a keypair |
71 | 71 | * |
72 | - * @param int $keyLenth |
|
72 | + * @param integer $keyLength |
|
73 | 73 | * @return array ['privatekey' => $privateKey, 'publickey' => $publicKey] |
74 | 74 | */ |
75 | 75 | public function createKey($keyLength) { |
@@ -36,51 +36,51 @@ |
||
36 | 36 | */ |
37 | 37 | class RSA extends AuthMechanism { |
38 | 38 | |
39 | - /** @var IConfig */ |
|
40 | - private $config; |
|
39 | + /** @var IConfig */ |
|
40 | + private $config; |
|
41 | 41 | |
42 | - public function __construct(IL10N $l, IConfig $config) { |
|
43 | - $this->config = $config; |
|
42 | + public function __construct(IL10N $l, IConfig $config) { |
|
43 | + $this->config = $config; |
|
44 | 44 | |
45 | - $this |
|
46 | - ->setIdentifier('publickey::rsa') |
|
47 | - ->setScheme(self::SCHEME_PUBLICKEY) |
|
48 | - ->setText($l->t('RSA public key')) |
|
49 | - ->addParameters([ |
|
50 | - new DefinitionParameter('user', $l->t('Username')), |
|
51 | - new DefinitionParameter('public_key', $l->t('Public key')), |
|
52 | - (new DefinitionParameter('private_key', 'private_key')) |
|
53 | - ->setType(DefinitionParameter::VALUE_HIDDEN), |
|
54 | - ]) |
|
55 | - ->addCustomJs('public_key') |
|
56 | - ; |
|
57 | - } |
|
45 | + $this |
|
46 | + ->setIdentifier('publickey::rsa') |
|
47 | + ->setScheme(self::SCHEME_PUBLICKEY) |
|
48 | + ->setText($l->t('RSA public key')) |
|
49 | + ->addParameters([ |
|
50 | + new DefinitionParameter('user', $l->t('Username')), |
|
51 | + new DefinitionParameter('public_key', $l->t('Public key')), |
|
52 | + (new DefinitionParameter('private_key', 'private_key')) |
|
53 | + ->setType(DefinitionParameter::VALUE_HIDDEN), |
|
54 | + ]) |
|
55 | + ->addCustomJs('public_key') |
|
56 | + ; |
|
57 | + } |
|
58 | 58 | |
59 | - public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
60 | - $auth = new RSACrypt(); |
|
61 | - $auth->setPassword($this->config->getSystemValue('secret', '')); |
|
62 | - if (!$auth->loadKey($storage->getBackendOption('private_key'))) { |
|
63 | - throw new \RuntimeException('unable to load private key'); |
|
64 | - } |
|
65 | - $storage->setBackendOption('public_key_auth', $auth); |
|
66 | - } |
|
59 | + public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) { |
|
60 | + $auth = new RSACrypt(); |
|
61 | + $auth->setPassword($this->config->getSystemValue('secret', '')); |
|
62 | + if (!$auth->loadKey($storage->getBackendOption('private_key'))) { |
|
63 | + throw new \RuntimeException('unable to load private key'); |
|
64 | + } |
|
65 | + $storage->setBackendOption('public_key_auth', $auth); |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * Generate a keypair |
|
70 | - * |
|
71 | - * @param int $keyLenth |
|
72 | - * @return array ['privatekey' => $privateKey, 'publickey' => $publicKey] |
|
73 | - */ |
|
74 | - public function createKey($keyLength) { |
|
75 | - $rsa = new RSACrypt(); |
|
76 | - $rsa->setPublicKeyFormat(RSACrypt::PUBLIC_FORMAT_OPENSSH); |
|
77 | - $rsa->setPassword($this->config->getSystemValue('secret', '')); |
|
68 | + /** |
|
69 | + * Generate a keypair |
|
70 | + * |
|
71 | + * @param int $keyLenth |
|
72 | + * @return array ['privatekey' => $privateKey, 'publickey' => $publicKey] |
|
73 | + */ |
|
74 | + public function createKey($keyLength) { |
|
75 | + $rsa = new RSACrypt(); |
|
76 | + $rsa->setPublicKeyFormat(RSACrypt::PUBLIC_FORMAT_OPENSSH); |
|
77 | + $rsa->setPassword($this->config->getSystemValue('secret', '')); |
|
78 | 78 | |
79 | - if ($keyLength !== 1024 && $keyLength !== 2048 && $keyLength !== 4096) { |
|
80 | - $keyLength = 1024; |
|
81 | - } |
|
79 | + if ($keyLength !== 1024 && $keyLength !== 2048 && $keyLength !== 4096) { |
|
80 | + $keyLength = 1024; |
|
81 | + } |
|
82 | 82 | |
83 | - return $rsa->createKey($keyLength); |
|
84 | - } |
|
83 | + return $rsa->createKey($keyLength); |
|
84 | + } |
|
85 | 85 | |
86 | 86 | } |