@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | public function createFile($name, $data = null) { |
45 | - throw new Forbidden('Permission denied to create file (filename ' . $name . ')'); |
|
45 | + throw new Forbidden('Permission denied to create file (filename '.$name.')'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function createDirectory($name) { |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $rootView = new View(); |
91 | 91 | $user = \OC::$server->getUserSession()->getUser(); |
92 | 92 | Filesystem::initMountPoints($user->getUID()); |
93 | - if (!$rootView->file_exists('/' . $user->getUID() . '/uploads')) { |
|
94 | - $rootView->mkdir('/' . $user->getUID() . '/uploads'); |
|
93 | + if (!$rootView->file_exists('/'.$user->getUID().'/uploads')) { |
|
94 | + $rootView->mkdir('/'.$user->getUID().'/uploads'); |
|
95 | 95 | } |
96 | - $view = new View('/' . $user->getUID() . '/uploads'); |
|
96 | + $view = new View('/'.$user->getUID().'/uploads'); |
|
97 | 97 | $rootInfo = $view->getFileInfo(''); |
98 | 98 | return new Directory($view, $rootInfo); |
99 | 99 | } |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitOAuth2 |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\OAuth2\\' => 11, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\OAuth2\\' => |
18 | - array ( |
|
19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
18 | + array( |
|
19 | + 0 => __DIR__.'/..'.'/../lib', |
|
20 | 20 | ), |
21 | 21 | ); |
22 | 22 | |
23 | - public static $classMap = array ( |
|
24 | - 'OCA\\OAuth2\\Controller\\LoginRedirectorController' => __DIR__ . '/..' . '/../lib/Controller/LoginRedirectorController.php', |
|
25 | - 'OCA\\OAuth2\\Controller\\OauthApiController' => __DIR__ . '/..' . '/../lib/Controller/OauthApiController.php', |
|
26 | - 'OCA\\OAuth2\\Controller\\SettingsController' => __DIR__ . '/..' . '/../lib/Controller/SettingsController.php', |
|
27 | - 'OCA\\OAuth2\\Db\\AccessToken' => __DIR__ . '/..' . '/../lib/Db/AccessToken.php', |
|
28 | - 'OCA\\OAuth2\\Db\\AccessTokenMapper' => __DIR__ . '/..' . '/../lib/Db/AccessTokenMapper.php', |
|
29 | - 'OCA\\OAuth2\\Db\\Client' => __DIR__ . '/..' . '/../lib/Db/Client.php', |
|
30 | - 'OCA\\OAuth2\\Db\\ClientMapper' => __DIR__ . '/..' . '/../lib/Db/ClientMapper.php', |
|
31 | - 'OCA\\OAuth2\\Exceptions\\AccessTokenNotFoundException' => __DIR__ . '/..' . '/../lib/Exceptions/AccessTokenNotFoundException.php', |
|
32 | - 'OCA\\OAuth2\\Exceptions\\ClientNotFoundException' => __DIR__ . '/..' . '/../lib/Exceptions/ClientNotFoundException.php', |
|
33 | - 'OCA\\OAuth2\\Migration\\SetTokenExpiration' => __DIR__ . '/..' . '/../lib/Migration/SetTokenExpiration.php', |
|
34 | - 'OCA\\OAuth2\\Migration\\Version010401Date20181207190718' => __DIR__ . '/..' . '/../lib/Migration/Version010401Date20181207190718.php', |
|
35 | - 'OCA\\OAuth2\\Migration\\Version010402Date20190107124745' => __DIR__ . '/..' . '/../lib/Migration/Version010402Date20190107124745.php', |
|
36 | - 'OCA\\OAuth2\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\OAuth2\\Controller\\LoginRedirectorController' => __DIR__.'/..'.'/../lib/Controller/LoginRedirectorController.php', |
|
25 | + 'OCA\\OAuth2\\Controller\\OauthApiController' => __DIR__.'/..'.'/../lib/Controller/OauthApiController.php', |
|
26 | + 'OCA\\OAuth2\\Controller\\SettingsController' => __DIR__.'/..'.'/../lib/Controller/SettingsController.php', |
|
27 | + 'OCA\\OAuth2\\Db\\AccessToken' => __DIR__.'/..'.'/../lib/Db/AccessToken.php', |
|
28 | + 'OCA\\OAuth2\\Db\\AccessTokenMapper' => __DIR__.'/..'.'/../lib/Db/AccessTokenMapper.php', |
|
29 | + 'OCA\\OAuth2\\Db\\Client' => __DIR__.'/..'.'/../lib/Db/Client.php', |
|
30 | + 'OCA\\OAuth2\\Db\\ClientMapper' => __DIR__.'/..'.'/../lib/Db/ClientMapper.php', |
|
31 | + 'OCA\\OAuth2\\Exceptions\\AccessTokenNotFoundException' => __DIR__.'/..'.'/../lib/Exceptions/AccessTokenNotFoundException.php', |
|
32 | + 'OCA\\OAuth2\\Exceptions\\ClientNotFoundException' => __DIR__.'/..'.'/../lib/Exceptions/ClientNotFoundException.php', |
|
33 | + 'OCA\\OAuth2\\Migration\\SetTokenExpiration' => __DIR__.'/..'.'/../lib/Migration/SetTokenExpiration.php', |
|
34 | + 'OCA\\OAuth2\\Migration\\Version010401Date20181207190718' => __DIR__.'/..'.'/../lib/Migration/Version010401Date20181207190718.php', |
|
35 | + 'OCA\\OAuth2\\Migration\\Version010402Date20190107124745' => __DIR__.'/..'.'/../lib/Migration/Version010402Date20190107124745.php', |
|
36 | + 'OCA\\OAuth2\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | public static function getInitializer(ClassLoader $loader) |
40 | 40 | { |
41 | - return \Closure::bind(function () use ($loader) { |
|
41 | + return \Closure::bind(function() use ($loader) { |
|
42 | 42 | $loader->prefixLengthsPsr4 = ComposerStaticInitOAuth2::$prefixLengthsPsr4; |
43 | 43 | $loader->prefixDirsPsr4 = ComposerStaticInitOAuth2::$prefixDirsPsr4; |
44 | 44 | $loader->classMap = ComposerStaticInitOAuth2::$classMap; |
@@ -6,17 +6,17 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\OAuth2\\Controller\\LoginRedirectorController' => $baseDir . '/../lib/Controller/LoginRedirectorController.php', |
|
10 | - 'OCA\\OAuth2\\Controller\\OauthApiController' => $baseDir . '/../lib/Controller/OauthApiController.php', |
|
11 | - 'OCA\\OAuth2\\Controller\\SettingsController' => $baseDir . '/../lib/Controller/SettingsController.php', |
|
12 | - 'OCA\\OAuth2\\Db\\AccessToken' => $baseDir . '/../lib/Db/AccessToken.php', |
|
13 | - 'OCA\\OAuth2\\Db\\AccessTokenMapper' => $baseDir . '/../lib/Db/AccessTokenMapper.php', |
|
14 | - 'OCA\\OAuth2\\Db\\Client' => $baseDir . '/../lib/Db/Client.php', |
|
15 | - 'OCA\\OAuth2\\Db\\ClientMapper' => $baseDir . '/../lib/Db/ClientMapper.php', |
|
16 | - 'OCA\\OAuth2\\Exceptions\\AccessTokenNotFoundException' => $baseDir . '/../lib/Exceptions/AccessTokenNotFoundException.php', |
|
17 | - 'OCA\\OAuth2\\Exceptions\\ClientNotFoundException' => $baseDir . '/../lib/Exceptions/ClientNotFoundException.php', |
|
18 | - 'OCA\\OAuth2\\Migration\\SetTokenExpiration' => $baseDir . '/../lib/Migration/SetTokenExpiration.php', |
|
19 | - 'OCA\\OAuth2\\Migration\\Version010401Date20181207190718' => $baseDir . '/../lib/Migration/Version010401Date20181207190718.php', |
|
20 | - 'OCA\\OAuth2\\Migration\\Version010402Date20190107124745' => $baseDir . '/../lib/Migration/Version010402Date20190107124745.php', |
|
21 | - 'OCA\\OAuth2\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
9 | + 'OCA\\OAuth2\\Controller\\LoginRedirectorController' => $baseDir.'/../lib/Controller/LoginRedirectorController.php', |
|
10 | + 'OCA\\OAuth2\\Controller\\OauthApiController' => $baseDir.'/../lib/Controller/OauthApiController.php', |
|
11 | + 'OCA\\OAuth2\\Controller\\SettingsController' => $baseDir.'/../lib/Controller/SettingsController.php', |
|
12 | + 'OCA\\OAuth2\\Db\\AccessToken' => $baseDir.'/../lib/Db/AccessToken.php', |
|
13 | + 'OCA\\OAuth2\\Db\\AccessTokenMapper' => $baseDir.'/../lib/Db/AccessTokenMapper.php', |
|
14 | + 'OCA\\OAuth2\\Db\\Client' => $baseDir.'/../lib/Db/Client.php', |
|
15 | + 'OCA\\OAuth2\\Db\\ClientMapper' => $baseDir.'/../lib/Db/ClientMapper.php', |
|
16 | + 'OCA\\OAuth2\\Exceptions\\AccessTokenNotFoundException' => $baseDir.'/../lib/Exceptions/AccessTokenNotFoundException.php', |
|
17 | + 'OCA\\OAuth2\\Exceptions\\ClientNotFoundException' => $baseDir.'/../lib/Exceptions/ClientNotFoundException.php', |
|
18 | + 'OCA\\OAuth2\\Migration\\SetTokenExpiration' => $baseDir.'/../lib/Migration/SetTokenExpiration.php', |
|
19 | + 'OCA\\OAuth2\\Migration\\Version010401Date20181207190718' => $baseDir.'/../lib/Migration/Version010401Date20181207190718.php', |
|
20 | + 'OCA\\OAuth2\\Migration\\Version010402Date20190107124745' => $baseDir.'/../lib/Migration/Version010402Date20190107124745.php', |
|
21 | + 'OCA\\OAuth2\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
22 | 22 | ); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | foreach ($users as $user) { |
148 | 148 | $event->setAffectedUser($user) |
149 | 149 | ->setSubject( |
150 | - $user === $currentUser ? $action . '_self' : $action, |
|
150 | + $user === $currentUser ? $action.'_self' : $action, |
|
151 | 151 | [ |
152 | 152 | 'actor' => $currentUser, |
153 | 153 | 'calendar' => [ |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $event, |
201 | 201 | $calendarData, |
202 | 202 | Calendar::SUBJECT_UNSHARE_USER, |
203 | - Calendar::SUBJECT_DELETE . '_self' |
|
203 | + Calendar::SUBJECT_DELETE.'_self' |
|
204 | 204 | ); |
205 | 205 | |
206 | 206 | if ($owner !== $principal[2]) { |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | ]; |
216 | 216 | |
217 | 217 | if ($owner === $event->getAuthor()) { |
218 | - $subject = Calendar::SUBJECT_UNSHARE_USER . '_you'; |
|
218 | + $subject = Calendar::SUBJECT_UNSHARE_USER.'_you'; |
|
219 | 219 | } else if ($principal[2] === $event->getAuthor()) { |
220 | - $subject = Calendar::SUBJECT_UNSHARE_USER . '_self'; |
|
220 | + $subject = Calendar::SUBJECT_UNSHARE_USER.'_self'; |
|
221 | 221 | } else { |
222 | 222 | $event->setAffectedUser($event->getAuthor()) |
223 | - ->setSubject(Calendar::SUBJECT_UNSHARE_USER . '_you', $parameters); |
|
223 | + ->setSubject(Calendar::SUBJECT_UNSHARE_USER.'_you', $parameters); |
|
224 | 224 | $this->activityManager->publish($event); |
225 | 225 | |
226 | - $subject = Calendar::SUBJECT_UNSHARE_USER . '_by'; |
|
226 | + $subject = Calendar::SUBJECT_UNSHARE_USER.'_by'; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | $event->setAffectedUser($owner) |
@@ -244,13 +244,13 @@ discard block |
||
244 | 244 | ]; |
245 | 245 | |
246 | 246 | if ($owner === $event->getAuthor()) { |
247 | - $subject = Calendar::SUBJECT_UNSHARE_GROUP . '_you'; |
|
247 | + $subject = Calendar::SUBJECT_UNSHARE_GROUP.'_you'; |
|
248 | 248 | } else { |
249 | 249 | $event->setAffectedUser($event->getAuthor()) |
250 | - ->setSubject(Calendar::SUBJECT_UNSHARE_GROUP . '_you', $parameters); |
|
250 | + ->setSubject(Calendar::SUBJECT_UNSHARE_GROUP.'_you', $parameters); |
|
251 | 251 | $this->activityManager->publish($event); |
252 | 252 | |
253 | - $subject = Calendar::SUBJECT_UNSHARE_GROUP . '_by'; |
|
253 | + $subject = Calendar::SUBJECT_UNSHARE_GROUP.'_by'; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | $event->setAffectedUser($owner) |
@@ -286,13 +286,13 @@ discard block |
||
286 | 286 | ]; |
287 | 287 | |
288 | 288 | if ($owner === $event->getAuthor()) { |
289 | - $subject = Calendar::SUBJECT_SHARE_USER . '_you'; |
|
289 | + $subject = Calendar::SUBJECT_SHARE_USER.'_you'; |
|
290 | 290 | } else { |
291 | 291 | $event->setAffectedUser($event->getAuthor()) |
292 | - ->setSubject(Calendar::SUBJECT_SHARE_USER . '_you', $parameters); |
|
292 | + ->setSubject(Calendar::SUBJECT_SHARE_USER.'_you', $parameters); |
|
293 | 293 | $this->activityManager->publish($event); |
294 | 294 | |
295 | - $subject = Calendar::SUBJECT_SHARE_USER . '_by'; |
|
295 | + $subject = Calendar::SUBJECT_SHARE_USER.'_by'; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | $event->setAffectedUser($owner) |
@@ -313,13 +313,13 @@ discard block |
||
313 | 313 | ]; |
314 | 314 | |
315 | 315 | if ($owner === $event->getAuthor()) { |
316 | - $subject = Calendar::SUBJECT_SHARE_GROUP . '_you'; |
|
316 | + $subject = Calendar::SUBJECT_SHARE_GROUP.'_you'; |
|
317 | 317 | } else { |
318 | 318 | $event->setAffectedUser($event->getAuthor()) |
319 | - ->setSubject(Calendar::SUBJECT_SHARE_GROUP . '_you', $parameters); |
|
319 | + ->setSubject(Calendar::SUBJECT_SHARE_GROUP.'_you', $parameters); |
|
320 | 320 | $this->activityManager->publish($event); |
321 | 321 | |
322 | - $subject = Calendar::SUBJECT_SHARE_GROUP . '_by'; |
|
322 | + $subject = Calendar::SUBJECT_SHARE_GROUP.'_by'; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | $event->setAffectedUser($owner) |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | |
419 | 419 | $classification = $objectData['classification'] ?? CalDavBackend::CLASSIFICATION_PUBLIC; |
420 | 420 | $object = $this->getObjectNameAndType($objectData); |
421 | - $action = $action . '_' . $object['type']; |
|
421 | + $action = $action.'_'.$object['type']; |
|
422 | 422 | |
423 | 423 | if ($object['type'] === 'todo' && strpos($action, Event::SUBJECT_OBJECT_UPDATE) === 0 && $object['status'] === 'COMPLETED') { |
424 | 424 | $action .= '_completed'; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | $event->setAffectedUser($user) |
445 | 445 | ->setSubject( |
446 | - $user === $currentUser ? $action . '_self' : $action, |
|
446 | + $user === $currentUser ? $action.'_self' : $action, |
|
447 | 447 | [ |
448 | 448 | 'actor' => $event->getAuthor(), |
449 | 449 | 'calendar' => [ |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | protected function getObjectNameAndType(array $objectData) { |
470 | 470 | $vObject = Reader::read($objectData['calendardata']); |
471 | 471 | $component = $componentType = null; |
472 | - foreach($vObject->getComponents() as $component) { |
|
472 | + foreach ($vObject->getComponents() as $component) { |
|
473 | 473 | if (in_array($component->name, ['VEVENT', 'VTODO'])) { |
474 | 474 | $componentType = $component->name; |
475 | 475 | break; |
@@ -91,17 +91,17 @@ discard block |
||
91 | 91 | $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar.svg'))); |
92 | 92 | } |
93 | 93 | |
94 | - if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event') { |
|
94 | + if ($event->getSubject() === self::SUBJECT_OBJECT_ADD.'_event') { |
|
95 | 95 | $subject = $this->l->t('{actor} created event {event} in calendar {calendar}'); |
96 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event_self') { |
|
96 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD.'_event_self') { |
|
97 | 97 | $subject = $this->l->t('You created event {event} in calendar {calendar}'); |
98 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event') { |
|
98 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE.'_event') { |
|
99 | 99 | $subject = $this->l->t('{actor} deleted event {event} from calendar {calendar}'); |
100 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event_self') { |
|
100 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE.'_event_self') { |
|
101 | 101 | $subject = $this->l->t('You deleted event {event} from calendar {calendar}'); |
102 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event') { |
|
102 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_event') { |
|
103 | 103 | $subject = $this->l->t('{actor} updated event {event} in calendar {calendar}'); |
104 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event_self') { |
|
104 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_event_self') { |
|
105 | 105 | $subject = $this->l->t('You updated event {event} in calendar {calendar}'); |
106 | 106 | } else { |
107 | 107 | throw new \InvalidArgumentException(); |
@@ -126,17 +126,17 @@ discard block |
||
126 | 126 | // Nextcloud 13+ |
127 | 127 | if (isset($parameters['calendar'])) { |
128 | 128 | switch ($subject) { |
129 | - case self::SUBJECT_OBJECT_ADD . '_event': |
|
130 | - case self::SUBJECT_OBJECT_DELETE . '_event': |
|
131 | - case self::SUBJECT_OBJECT_UPDATE . '_event': |
|
129 | + case self::SUBJECT_OBJECT_ADD.'_event': |
|
130 | + case self::SUBJECT_OBJECT_DELETE.'_event': |
|
131 | + case self::SUBJECT_OBJECT_UPDATE.'_event': |
|
132 | 132 | return [ |
133 | 133 | 'actor' => $this->generateUserParameter($parameters['actor']), |
134 | 134 | 'calendar' => $this->generateCalendarParameter($parameters['calendar'], $this->l), |
135 | 135 | 'event' => $this->generateClassifiedObjectParameter($parameters['object']), |
136 | 136 | ]; |
137 | - case self::SUBJECT_OBJECT_ADD . '_event_self': |
|
138 | - case self::SUBJECT_OBJECT_DELETE . '_event_self': |
|
139 | - case self::SUBJECT_OBJECT_UPDATE . '_event_self': |
|
137 | + case self::SUBJECT_OBJECT_ADD.'_event_self': |
|
138 | + case self::SUBJECT_OBJECT_DELETE.'_event_self': |
|
139 | + case self::SUBJECT_OBJECT_UPDATE.'_event_self': |
|
140 | 140 | return [ |
141 | 141 | 'calendar' => $this->generateCalendarParameter($parameters['calendar'], $this->l), |
142 | 142 | 'event' => $this->generateClassifiedObjectParameter($parameters['object']), |
@@ -150,19 +150,19 @@ discard block |
||
150 | 150 | // Otherwise if people upgrade over multiple releases in a short period, |
151 | 151 | // they will get the dead entries in their stream. |
152 | 152 | switch ($subject) { |
153 | - case self::SUBJECT_OBJECT_ADD . '_event': |
|
154 | - case self::SUBJECT_OBJECT_DELETE . '_event': |
|
155 | - case self::SUBJECT_OBJECT_UPDATE . '_event': |
|
153 | + case self::SUBJECT_OBJECT_ADD.'_event': |
|
154 | + case self::SUBJECT_OBJECT_DELETE.'_event': |
|
155 | + case self::SUBJECT_OBJECT_UPDATE.'_event': |
|
156 | 156 | return [ |
157 | 157 | 'actor' => $this->generateUserParameter($parameters[0]), |
158 | - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), |
|
158 | + 'calendar' => $this->generateLegacyCalendarParameter((int) $event->getObjectId(), $parameters[1]), |
|
159 | 159 | 'event' => $this->generateObjectParameter($parameters[2]), |
160 | 160 | ]; |
161 | - case self::SUBJECT_OBJECT_ADD . '_event_self': |
|
162 | - case self::SUBJECT_OBJECT_DELETE . '_event_self': |
|
163 | - case self::SUBJECT_OBJECT_UPDATE . '_event_self': |
|
161 | + case self::SUBJECT_OBJECT_ADD.'_event_self': |
|
162 | + case self::SUBJECT_OBJECT_DELETE.'_event_self': |
|
163 | + case self::SUBJECT_OBJECT_UPDATE.'_event_self': |
|
164 | 164 | return [ |
165 | - 'calendar' => $this->generateLegacyCalendarParameter((int)$event->getObjectId(), $parameters[1]), |
|
165 | + 'calendar' => $this->generateLegacyCalendarParameter((int) $event->getObjectId(), $parameters[1]), |
|
166 | 166 | 'event' => $this->generateObjectParameter($parameters[2]), |
167 | 167 | ]; |
168 | 168 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $delete->setParameter('owner', $this->getPrincipal($row['principaluri'])) |
79 | 79 | ->setParameter('type', 'calendar') |
80 | 80 | ->setParameter('calendar_id', $row['calendarid']) |
81 | - ->setParameter('event_uid', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '"') . '%'); |
|
81 | + ->setParameter('event_uid', '%'.$this->connection->escapeLikeParameter('{"id":"'.$row['uid'].'"').'%'); |
|
82 | 82 | $deletedEvents += $delete->execute(); |
83 | 83 | } |
84 | 84 | $result->closeCursor(); |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | $delete->setParameter('owner', $this->getPrincipal($row['principaluri'])) |
109 | 109 | ->setParameter('type', 'calendar') |
110 | 110 | ->setParameter('calendar_id', $row['calendarid']) |
111 | - ->setParameter('event_uid', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '"') . '%') |
|
112 | - ->setParameter('filtered_name', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '","name":"Busy"') . '%'); |
|
111 | + ->setParameter('event_uid', '%'.$this->connection->escapeLikeParameter('{"id":"'.$row['uid'].'"').'%') |
|
112 | + ->setParameter('filtered_name', '%'.$this->connection->escapeLikeParameter('{"id":"'.$row['uid'].'","name":"Busy"').'%'); |
|
113 | 113 | $deletedEvents += $delete->execute(); |
114 | 114 | } |
115 | 115 | $result->closeCursor(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | private function getCachedToken(string $cacheKey) { |
65 | - $cachedTokenString = $this->cache->get($cacheKey . '/token'); |
|
65 | + $cachedTokenString = $this->cache->get($cacheKey.'/token'); |
|
66 | 66 | if ($cachedTokenString) { |
67 | 67 | return json_decode($cachedTokenString, true); |
68 | 68 | } else { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | ] |
87 | 87 | ]); |
88 | 88 | } |
89 | - $this->cache->set($cacheKey . '/token', $value); |
|
89 | + $this->cache->set($cacheKey.'/token', $value); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | $this->params = array_merge(self::DEFAULT_OPTIONS, $this->params); |
115 | 115 | |
116 | - $cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['container']; |
|
116 | + $cacheKey = $userName.'@'.$this->params['url'].'/'.$this->params['container']; |
|
117 | 117 | $token = $this->getCachedToken($cacheKey); |
118 | 118 | $this->params['cachedToken'] = $token; |
119 | 119 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if ($authService instanceof IdentityV3Service) { |
150 | 150 | $token = $authService->generateTokenFromCache($cachedToken); |
151 | 151 | if (\is_null($token->catalog)) { |
152 | - $this->logger->warning('Invalid cached token for swift, no catalog set: ' . json_encode($cachedToken)); |
|
152 | + $this->logger->warning('Invalid cached token for swift, no catalog set: '.json_encode($cachedToken)); |
|
153 | 153 | } else if ($token->hasExpired()) { |
154 | 154 | $this->logger->debug('Cached token for swift expired'); |
155 | 155 | } else { |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } catch (ConnectException $e) { |
243 | 243 | /** @var RequestInterface $request */ |
244 | 244 | $request = $e->getRequest(); |
245 | - $host = $request->getUri()->getHost() . ':' . $request->getUri()->getPort(); |
|
245 | + $host = $request->getUri()->getHost().':'.$request->getUri()->getPort(); |
|
246 | 246 | \OC::$server->getLogger()->error("Can't connect to object storage server at $host"); |
247 | 247 | throw new StorageNotAvailableException("Can't connect to object storage server at $host", StorageNotAvailableException::STATUS_ERROR, $e); |
248 | 248 | } |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | throw new LoginException($message); |
354 | 354 | } |
355 | 355 | |
356 | - if($regenerateSessionId) { |
|
356 | + if ($regenerateSessionId) { |
|
357 | 357 | $this->session->regenerateId(); |
358 | 358 | } |
359 | 359 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $loginDetails['password'], |
375 | 375 | $isToken, |
376 | 376 | ]); |
377 | - if($this->isLoggedIn()) { |
|
377 | + if ($this->isLoggedIn()) { |
|
378 | 378 | $this->prepareUserLogin($firstTimeLogin, $regenerateSessionId); |
379 | 379 | return true; |
380 | 380 | } |
@@ -422,13 +422,13 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // Try to login with this username and password |
425 | - if (!$this->login($user, $password) ) { |
|
425 | + if (!$this->login($user, $password)) { |
|
426 | 426 | |
427 | 427 | // Failed, maybe the user used their email address |
428 | 428 | $users = $this->manager->getByEmail($user); |
429 | 429 | if (!(\count($users) === 1 && $this->login($users[0]->getUID(), $password))) { |
430 | 430 | |
431 | - $this->logger->warning('Login failed: \'' . $user . '\' (Remote IP: \'' . \OC::$server->getRequest()->getRemoteAddress() . '\')', ['app' => 'core']); |
|
431 | + $this->logger->warning('Login failed: \''.$user.'\' (Remote IP: \''.\OC::$server->getRequest()->getRemoteAddress().'\')', ['app' => 'core']); |
|
432 | 432 | |
433 | 433 | $throttler->registerAttempt('login', $request->getRemoteAddress(), ['user' => $user]); |
434 | 434 | if ($currentDelay === 0) { |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | |
441 | 441 | if ($isTokenPassword) { |
442 | 442 | $this->session->set('app_password', $password); |
443 | - } else if($this->supportsCookies($request)) { |
|
443 | + } else if ($this->supportsCookies($request)) { |
|
444 | 444 | // Password login, but cookies supported -> create (browser) session token |
445 | 445 | $this->createSessionToken($request, $this->getUser()->getUID(), $user, $password); |
446 | 446 | } |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | } |
524 | 524 | |
525 | 525 | // trigger any other initialization |
526 | - \OC::$server->getEventDispatcher()->dispatch(IUser::class . '::firstLogin', new GenericEvent($this->getUser())); |
|
526 | + \OC::$server->getEventDispatcher()->dispatch(IUser::class.'::firstLogin', new GenericEvent($this->getUser())); |
|
527 | 527 | } |
528 | 528 | } |
529 | 529 | |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | private function checkTokenCredentials(IToken $dbToken, $token) { |
686 | 686 | // Check whether login credentials are still valid and the user was not disabled |
687 | 687 | // This check is performed each 5 minutes |
688 | - $lastCheck = $dbToken->getLastCheck() ? : 0; |
|
688 | + $lastCheck = $dbToken->getLastCheck() ?: 0; |
|
689 | 689 | $now = $this->timeFactory->getTime(); |
690 | 690 | if ($lastCheck > ($now - 60 * 5)) { |
691 | 691 | // Checked performed recently, nothing to do now |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | if (!$this->loginWithToken($token)) { |
786 | 786 | return false; |
787 | 787 | } |
788 | - if(!$this->validateToken($token)) { |
|
788 | + if (!$this->validateToken($token)) { |
|
789 | 789 | return false; |
790 | 790 | } |
791 | 791 | |
@@ -947,9 +947,9 @@ discard block |
||
947 | 947 | setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, '', $secureCookie, true); |
948 | 948 | // old cookies might be stored under /webroot/ instead of /webroot |
949 | 949 | // and Firefox doesn't like it! |
950 | - setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true); |
|
951 | - setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true); |
|
952 | - setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true); |
|
950 | + setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT.'/', '', $secureCookie, true); |
|
951 | + setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT.'/', '', $secureCookie, true); |
|
952 | + setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT.'/', '', $secureCookie, true); |
|
953 | 953 | } |
954 | 954 | |
955 | 955 | /** |
@@ -153,16 +153,16 @@ discard block |
||
153 | 153 | // Check the group exists |
154 | 154 | $group = $this->groupManager->get($groupId); |
155 | 155 | if ($group !== null) { |
156 | - $isSubadminOfGroup =$this->groupManager->getSubAdmin()->isSubAdminOfGroup($user, $group); |
|
156 | + $isSubadminOfGroup = $this->groupManager->getSubAdmin()->isSubAdminOfGroup($user, $group); |
|
157 | 157 | } else { |
158 | 158 | throw new OCSNotFoundException('The requested group could not be found'); |
159 | 159 | } |
160 | 160 | |
161 | 161 | // Check subadmin has access to this group |
162 | - if($this->groupManager->isAdmin($user->getUID()) |
|
162 | + if ($this->groupManager->isAdmin($user->getUID()) |
|
163 | 163 | || $isSubadminOfGroup) { |
164 | 164 | $users = $this->groupManager->get($groupId)->getUsers(); |
165 | - $users = array_map(function($user) { |
|
165 | + $users = array_map(function($user) { |
|
166 | 166 | /** @var IUser $user */ |
167 | 167 | return $user->getUID(); |
168 | 168 | }, $users); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | // Check subadmin has access to this group |
200 | - if($this->groupManager->isAdmin($currentUser->getUID()) || $isSubadminOfGroup) { |
|
200 | + if ($this->groupManager->isAdmin($currentUser->getUID()) || $isSubadminOfGroup) { |
|
201 | 201 | $users = $group->searchUsers($search, $limit, $offset); |
202 | 202 | |
203 | 203 | // Extract required number |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | foreach ($users as $user) { |
206 | 206 | try { |
207 | 207 | /** @var IUser $user */ |
208 | - $userId = (string)$user->getUID(); |
|
208 | + $userId = (string) $user->getUID(); |
|
209 | 209 | $userData = $this->getUserData($userId); |
210 | 210 | // Do not insert empty entry |
211 | 211 | if (!empty($userData)) { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | // only showing its id |
216 | 216 | $usersDetails[$userId] = ['id' => $userId]; |
217 | 217 | } |
218 | - } catch(OCSNotFoundException $e) { |
|
218 | + } catch (OCSNotFoundException $e) { |
|
219 | 219 | // continue if a users ceased to exist. |
220 | 220 | } |
221 | 221 | } |
@@ -236,12 +236,12 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function addGroup(string $groupid): DataResponse { |
238 | 238 | // Validate name |
239 | - if(empty($groupid)) { |
|
239 | + if (empty($groupid)) { |
|
240 | 240 | $this->logger->error('Group name not supplied', ['app' => 'provisioning_api']); |
241 | 241 | throw new OCSException('Invalid group name', 101); |
242 | 242 | } |
243 | 243 | // Check if it exists |
244 | - if($this->groupManager->groupExists($groupid)){ |
|
244 | + if ($this->groupManager->groupExists($groupid)) { |
|
245 | 245 | throw new OCSException('group exists', 102); |
246 | 246 | } |
247 | 247 | $this->groupManager->createGroup($groupid); |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function deleteGroup(string $groupId): DataResponse { |
259 | 259 | // Check it exists |
260 | - if(!$this->groupManager->groupExists($groupId)){ |
|
260 | + if (!$this->groupManager->groupExists($groupId)) { |
|
261 | 261 | throw new OCSException('', 101); |
262 | - } else if($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()){ |
|
262 | + } else if ($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()) { |
|
263 | 263 | // Cannot delete admin group |
264 | 264 | throw new OCSException('', 102); |
265 | 265 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | public function getSubAdminsOfGroup(string $groupId): DataResponse { |
276 | 276 | // Check group exists |
277 | 277 | $targetGroup = $this->groupManager->get($groupId); |
278 | - if($targetGroup === null) { |
|
278 | + if ($targetGroup === null) { |
|
279 | 279 | throw new OCSException('Group does not exist', 101); |
280 | 280 | } |
281 | 281 |