@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | |
23 | -require_once __DIR__ . '/../lib/base.php'; |
|
23 | +require_once __DIR__.'/../lib/base.php'; |
|
24 | 24 | |
25 | 25 | header('Content-Type: application/json'); |
26 | 26 |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitFederatedFileSharing |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\FederatedFileSharing\\' => 25, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\FederatedFileSharing\\' => |
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\\FederatedFileSharing\\AddressHandler' => __DIR__ . '/..' . '/../lib/AddressHandler.php', |
|
25 | - 'OCA\\FederatedFileSharing\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
26 | - 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/RetryJob.php', |
|
27 | - 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__ . '/..' . '/../lib/Controller/MountPublicLinkController.php', |
|
28 | - 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__ . '/..' . '/../lib/Controller/RequestHandlerController.php', |
|
29 | - 'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__ . '/..' . '/../lib/FederatedShareProvider.php', |
|
30 | - 'OCA\\FederatedFileSharing\\Notifications' => __DIR__ . '/..' . '/../lib/Notifications.php', |
|
31 | - 'OCA\\FederatedFileSharing\\Notifier' => __DIR__ . '/..' . '/../lib/Notifier.php', |
|
32 | - 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__ . '/..' . '/../lib/ocm/CloudFederationProviderFiles.php', |
|
33 | - 'OCA\\FederatedFileSharing\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
34 | - 'OCA\\FederatedFileSharing\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php', |
|
35 | - 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => __DIR__ . '/..' . '/../lib/Settings/PersonalSection.php', |
|
36 | - 'OCA\\FederatedFileSharing\\TokenHandler' => __DIR__ . '/..' . '/../lib/TokenHandler.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\FederatedFileSharing\\AddressHandler' => __DIR__.'/..'.'/../lib/AddressHandler.php', |
|
25 | + 'OCA\\FederatedFileSharing\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
26 | + 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => __DIR__.'/..'.'/../lib/BackgroundJob/RetryJob.php', |
|
27 | + 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__.'/..'.'/../lib/Controller/MountPublicLinkController.php', |
|
28 | + 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__.'/..'.'/../lib/Controller/RequestHandlerController.php', |
|
29 | + 'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__.'/..'.'/../lib/FederatedShareProvider.php', |
|
30 | + 'OCA\\FederatedFileSharing\\Notifications' => __DIR__.'/..'.'/../lib/Notifications.php', |
|
31 | + 'OCA\\FederatedFileSharing\\Notifier' => __DIR__.'/..'.'/../lib/Notifier.php', |
|
32 | + 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__.'/..'.'/../lib/ocm/CloudFederationProviderFiles.php', |
|
33 | + 'OCA\\FederatedFileSharing\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
34 | + 'OCA\\FederatedFileSharing\\Settings\\Personal' => __DIR__.'/..'.'/../lib/Settings/Personal.php', |
|
35 | + 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => __DIR__.'/..'.'/../lib/Settings/PersonalSection.php', |
|
36 | + 'OCA\\FederatedFileSharing\\TokenHandler' => __DIR__.'/..'.'/../lib/TokenHandler.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 = ComposerStaticInitFederatedFileSharing::$prefixLengthsPsr4; |
43 | 43 | $loader->prefixDirsPsr4 = ComposerStaticInitFederatedFileSharing::$prefixDirsPsr4; |
44 | 44 | $loader->classMap = ComposerStaticInitFederatedFileSharing::$classMap; |
@@ -6,17 +6,17 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\FederatedFileSharing\\AddressHandler' => $baseDir . '/../lib/AddressHandler.php', |
|
10 | - 'OCA\\FederatedFileSharing\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
11 | - 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => $baseDir . '/../lib/BackgroundJob/RetryJob.php', |
|
12 | - 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir . '/../lib/Controller/MountPublicLinkController.php', |
|
13 | - 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir . '/../lib/Controller/RequestHandlerController.php', |
|
14 | - 'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir . '/../lib/FederatedShareProvider.php', |
|
15 | - 'OCA\\FederatedFileSharing\\Notifications' => $baseDir . '/../lib/Notifications.php', |
|
16 | - 'OCA\\FederatedFileSharing\\Notifier' => $baseDir . '/../lib/Notifier.php', |
|
17 | - 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir . '/../lib/ocm/CloudFederationProviderFiles.php', |
|
18 | - 'OCA\\FederatedFileSharing\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
19 | - 'OCA\\FederatedFileSharing\\Settings\\Personal' => $baseDir . '/../lib/Settings/Personal.php', |
|
20 | - 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => $baseDir . '/../lib/Settings/PersonalSection.php', |
|
21 | - 'OCA\\FederatedFileSharing\\TokenHandler' => $baseDir . '/../lib/TokenHandler.php', |
|
9 | + 'OCA\\FederatedFileSharing\\AddressHandler' => $baseDir.'/../lib/AddressHandler.php', |
|
10 | + 'OCA\\FederatedFileSharing\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
11 | + 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => $baseDir.'/../lib/BackgroundJob/RetryJob.php', |
|
12 | + 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir.'/../lib/Controller/MountPublicLinkController.php', |
|
13 | + 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir.'/../lib/Controller/RequestHandlerController.php', |
|
14 | + 'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir.'/../lib/FederatedShareProvider.php', |
|
15 | + 'OCA\\FederatedFileSharing\\Notifications' => $baseDir.'/../lib/Notifications.php', |
|
16 | + 'OCA\\FederatedFileSharing\\Notifier' => $baseDir.'/../lib/Notifier.php', |
|
17 | + 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir.'/../lib/ocm/CloudFederationProviderFiles.php', |
|
18 | + 'OCA\\FederatedFileSharing\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
19 | + 'OCA\\FederatedFileSharing\\Settings\\Personal' => $baseDir.'/../lib/Settings/Personal.php', |
|
20 | + 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => $baseDir.'/../lib/Settings/PersonalSection.php', |
|
21 | + 'OCA\\FederatedFileSharing\\TokenHandler' => $baseDir.'/../lib/TokenHandler.php', |
|
22 | 22 | ); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function __construct($providerId) { |
34 | 34 | $l = \OC::$server->getL10N('federation'); |
35 | - $message = 'Cloud Federation Provider with ID: "' . $providerId . '" does not exist.'; |
|
35 | + $message = 'Cloud Federation Provider with ID: "'.$providerId.'" does not exist.'; |
|
36 | 36 | $hint = $l->t('Cloud Federation Provider with ID: "%s" does not exist.', [$providerId]); |
37 | 37 | parent::__construct($message, $hint); |
38 | 38 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function __construct($newProviderId, $existingProviderName) { |
35 | 35 | $l = \OC::$server->getL10N('federation'); |
36 | - $message = 'Id "' . $newProviderId . '" already used by cloud federation provider "' . $existingProviderName . '"'; |
|
36 | + $message = 'Id "'.$newProviderId.'" already used by cloud federation provider "'.$existingProviderName.'"'; |
|
37 | 37 | $hint = $l->t('Id "%s" already used by cloud federation provider "%s"', [$newProviderId, $existingProviderName]); |
38 | 38 | parent::__construct($message, $hint); |
39 | 39 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function __construct($action) { |
33 | 33 | $l = \OC::$server->getL10N('federation'); |
34 | - $message = 'Action "' . $action . '" not supported or implemented.'; |
|
34 | + $message = 'Action "'.$action.'" not supported or implemented.'; |
|
35 | 35 | $hint = $l->t('Action "%s" not supported or implemented.', [$action]); |
36 | 36 | parent::__construct($message, $hint); |
37 | 37 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | IClientService $httpClientService, |
72 | 72 | ICloudIdManager $cloudIdManager, |
73 | 73 | ILogger $logger) { |
74 | - $this->cloudFederationProvider= []; |
|
74 | + $this->cloudFederationProvider = []; |
|
75 | 75 | $this->appManager = $appManager; |
76 | 76 | $this->httpClientService = $httpClientService; |
77 | 77 | $this->cloudIdManager = $cloudIdManager; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $client = $this->httpClientService->newClient(); |
142 | 142 | try { |
143 | - $response = $client->post($ocmEndPoint . '/shares', [ |
|
143 | + $response = $client->post($ocmEndPoint.'/shares', [ |
|
144 | 144 | 'body' => $share->getShare(), |
145 | 145 | 'timeout' => 10, |
146 | 146 | 'connect_timeout' => 10, |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | $client = $this->httpClientService->newClient(); |
179 | 179 | try { |
180 | - $response = $client->post($ocmEndPoint . '/notifications', [ |
|
180 | + $response = $client->post($ocmEndPoint.'/notifications', [ |
|
181 | 181 | 'body' => $notification->getMessage(), |
182 | 182 | 'timeout' => 10, |
183 | 183 | 'connect_timeout' => 10, |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | } catch (\Exception $e) { |
189 | 189 | // log the error and return false |
190 | - $this->logger->error('error while sending notification for federated share: ' . $e->getMessage()); |
|
190 | + $this->logger->error('error while sending notification for federated share: '.$e->getMessage()); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | return false; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | protected function getOCMEndPoint($url) { |
211 | 211 | $client = $this->httpClientService->newClient(); |
212 | 212 | try { |
213 | - $response = $client->get($url . '/ocm-provider/', ['timeout' => 10, 'connect_timeout' => 10]); |
|
213 | + $response = $client->get($url.'/ocm-provider/', ['timeout' => 10, 'connect_timeout' => 10]); |
|
214 | 214 | } catch (\Exception $e) { |
215 | 215 | return ''; |
216 | 216 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $l = \OC::$server->getL10N('federation'); |
37 | 37 | $this->parameterList = $missingParameters; |
38 | 38 | $parameterList = implode(',', $missingParameters); |
39 | - $message = 'Parameters missing in order to complete the request. Missing Parameters: ' . $parameterList; |
|
39 | + $message = 'Parameters missing in order to complete the request. Missing Parameters: '.$parameterList; |
|
40 | 40 | $hint = $l->t('Parameters missing in order to complete the request. Missing Parameters: "%s"', [$parameterList]); |
41 | 41 | parent::__construct($message, $hint); |
42 | 42 | } |
@@ -247,8 +247,7 @@ |
||
247 | 247 | return new JSONResponse($e->getReturnMessage(), Http::STATUS_BAD_REQUEST); |
248 | 248 | } catch (AuthenticationFailedException $e) { |
249 | 249 | return new JSONResponse(["message" => "RESOURCE_NOT_FOUND"], Http::STATUS_FORBIDDEN); |
250 | - } |
|
251 | - catch (\Exception $e) { |
|
250 | + } catch (\Exception $e) { |
|
252 | 251 | return new JSONResponse( |
253 | 252 | ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
254 | 253 | Http::STATUS_BAD_REQUEST |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $supportedShareTypes = $this->config->getSupportedShareTypes($resourceType); |
146 | 146 | if (!in_array($shareType, $supportedShareTypes)) { |
147 | 147 | return new JSONResponse( |
148 | - ['message' => 'Share type "' . $shareType . '" not implemented'], |
|
148 | + ['message' => 'Share type "'.$shareType.'" not implemented'], |
|
149 | 149 | Http::STATUS_NOT_IMPLEMENTED |
150 | 150 | ); |
151 | 151 | } |
@@ -158,16 +158,16 @@ discard block |
||
158 | 158 | |
159 | 159 | if (!$this->userManager->userExists($shareWith)) { |
160 | 160 | return new JSONResponse( |
161 | - ['message' => 'User "' . $shareWith . '" does not exists at ' . $this->urlGenerator->getBaseUrl()], |
|
161 | + ['message' => 'User "'.$shareWith.'" does not exists at '.$this->urlGenerator->getBaseUrl()], |
|
162 | 162 | Http::STATUS_BAD_REQUEST |
163 | 163 | ); |
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
167 | 167 | if ($shareType === 'group') { |
168 | - if(!$this->groupManager->groupExists($shareWith)) { |
|
168 | + if (!$this->groupManager->groupExists($shareWith)) { |
|
169 | 169 | return new JSONResponse( |
170 | - ['message' => 'Group "' . $shareWith . '" does not exists at ' . $this->urlGenerator->getBaseUrl()], |
|
170 | + ['message' => 'Group "'.$shareWith.'" does not exists at '.$this->urlGenerator->getBaseUrl()], |
|
171 | 171 | Http::STATUS_BAD_REQUEST |
172 | 172 | ); |
173 | 173 | } |
@@ -200,14 +200,14 @@ discard block |
||
200 | 200 | ); |
201 | 201 | } catch (\Exception $e) { |
202 | 202 | return new JSONResponse( |
203 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
203 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
204 | 204 | Http::STATUS_BAD_REQUEST |
205 | 205 | ); |
206 | 206 | } |
207 | 207 | |
208 | 208 | $user = $this->userManager->get($shareWith); |
209 | 209 | $recipientDisplayName = ''; |
210 | - if($user) { |
|
210 | + if ($user) { |
|
211 | 211 | $recipientDisplayName = $user->getDisplayName(); |
212 | 212 | } |
213 | 213 | |
@@ -269,12 +269,12 @@ discard block |
||
269 | 269 | } |
270 | 270 | catch (\Exception $e) { |
271 | 271 | return new JSONResponse( |
272 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
272 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
273 | 273 | Http::STATUS_BAD_REQUEST |
274 | 274 | ); |
275 | 275 | } |
276 | 276 | |
277 | - return new JSONResponse($result,Http::STATUS_CREATED); |
|
277 | + return new JSONResponse($result, Http::STATUS_CREATED); |
|
278 | 278 | |
279 | 279 | } |
280 | 280 | |
@@ -286,13 +286,13 @@ discard block |
||
286 | 286 | */ |
287 | 287 | private function mapUid($uid) { |
288 | 288 | // FIXME this should be a method in the user management instead |
289 | - $this->logger->debug('shareWith before, ' . $uid, ['app' => $this->appName]); |
|
289 | + $this->logger->debug('shareWith before, '.$uid, ['app' => $this->appName]); |
|
290 | 290 | \OCP\Util::emitHook( |
291 | 291 | '\OCA\Files_Sharing\API\Server2Server', |
292 | 292 | 'preLoginNameUsedAsUserName', |
293 | 293 | array('uid' => &$uid) |
294 | 294 | ); |
295 | - $this->logger->debug('shareWith after, ' . $uid, ['app' => $this->appName]); |
|
295 | + $this->logger->debug('shareWith after, '.$uid, ['app' => $this->appName]); |
|
296 | 296 | |
297 | 297 | return $uid; |
298 | 298 | } |