@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | IClientService $httpClientService, |
| 70 | 70 | ICloudIdManager $cloudIdManager, |
| 71 | 71 | ILogger $logger) { |
| 72 | - $this->cloudFederationProvider= []; |
|
| 72 | + $this->cloudFederationProvider = []; |
|
| 73 | 73 | $this->appManager = $appManager; |
| 74 | 74 | $this->httpClientService = $httpClientService; |
| 75 | 75 | $this->cloudIdManager = $cloudIdManager; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | $client = $this->httpClientService->newClient(); |
| 139 | 139 | try { |
| 140 | - $response = $client->post($ocmEndPoint . '/shares', [ |
|
| 140 | + $response = $client->post($ocmEndPoint.'/shares', [ |
|
| 141 | 141 | 'body' => $share->getShare(), |
| 142 | 142 | 'timeout' => 10, |
| 143 | 143 | 'connect_timeout' => 10, |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | $client = $this->httpClientService->newClient(); |
| 176 | 176 | try { |
| 177 | - $response = $client->post($ocmEndPoint . '/notifications', [ |
|
| 177 | + $response = $client->post($ocmEndPoint.'/notifications', [ |
|
| 178 | 178 | 'body' => $notification->getMessage(), |
| 179 | 179 | 'timeout' => 10, |
| 180 | 180 | 'connect_timeout' => 10, |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | } catch (\Exception $e) { |
| 186 | 186 | // log the error and return false |
| 187 | - $this->logger->error('error while sending notification for federated share: ' . $e->getMessage()); |
|
| 187 | + $this->logger->error('error while sending notification for federated share: '.$e->getMessage()); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | return false; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $cloudId = $this->cloudIdManager->resolveCloudId($recipient); |
| 209 | 209 | $client = $this->httpClientService->newClient(); |
| 210 | 210 | try { |
| 211 | - $response = $client->get($cloudId->getRemote() . '/ocm-provider/', ['timeout' => 10, 'connect_timeout' => 10]); |
|
| 211 | + $response = $client->get($cloudId->getRemote().'/ocm-provider/', ['timeout' => 10, 'connect_timeout' => 10]); |
|
| 212 | 212 | } catch (\Exception $e) { |
| 213 | 213 | return ''; |
| 214 | 214 | } |
@@ -131,18 +131,18 @@ discard block |
||
| 131 | 131 | * @param int $remoteId |
| 132 | 132 | * @return Mount|null |
| 133 | 133 | */ |
| 134 | - public function addShare($remote, $token, $password, $name, $owner, $accepted=false, $user = null, $remoteId = -1) { |
|
| 134 | + public function addShare($remote, $token, $password, $name, $owner, $accepted = false, $user = null, $remoteId = -1) { |
|
| 135 | 135 | |
| 136 | 136 | $user = $user ? $user : $this->uid; |
| 137 | 137 | $accepted = $accepted ? 1 : 0; |
| 138 | - $name = Filesystem::normalizePath('/' . $name); |
|
| 138 | + $name = Filesystem::normalizePath('/'.$name); |
|
| 139 | 139 | |
| 140 | 140 | if (!$accepted) { |
| 141 | 141 | // To avoid conflicts with the mount point generation later, |
| 142 | 142 | // we only use a temporary mount point name here. The real |
| 143 | 143 | // mount point name will be generated when accepting the share, |
| 144 | 144 | // using the original share item name. |
| 145 | - $tmpMountPointName = '{{TemporaryMountPointName#' . $name . '}}'; |
|
| 145 | + $tmpMountPointName = '{{TemporaryMountPointName#'.$name.'}}'; |
|
| 146 | 146 | $mountPoint = $tmpMountPointName; |
| 147 | 147 | $hash = md5($tmpMountPointName); |
| 148 | 148 | $data = [ |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $i = 1; |
| 162 | 162 | while (!$this->connection->insertIfNotExist('*PREFIX*share_external', $data, ['user', 'mountpoint_hash'])) { |
| 163 | 163 | // The external share already exists for the user |
| 164 | - $data['mountpoint'] = $tmpMountPointName . '-' . $i; |
|
| 164 | + $data['mountpoint'] = $tmpMountPointName.'-'.$i; |
|
| 165 | 165 | $data['mountpoint_hash'] = md5($data['mountpoint']); |
| 166 | 166 | $i++; |
| 167 | 167 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $mountPoint = Files::buildNotExistingFileName('/', $name); |
| 172 | - $mountPoint = Filesystem::normalizePath('/' . $mountPoint); |
|
| 172 | + $mountPoint = Filesystem::normalizePath('/'.$mountPoint); |
|
| 173 | 173 | $hash = md5($mountPoint); |
| 174 | 174 | |
| 175 | 175 | $query = $this->connection->prepare(' |
@@ -290,14 +290,14 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | $result = $this->tryOCMEndPoint($remote, $token, $remoteId, $feedback); |
| 292 | 292 | |
| 293 | - if($result === true) { |
|
| 293 | + if ($result === true) { |
|
| 294 | 294 | return true; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | $federationEndpoints = $this->discoveryService->discover($remote, 'FEDERATED_SHARING'); |
| 298 | 298 | $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; |
| 299 | 299 | |
| 300 | - $url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT; |
|
| 300 | + $url = rtrim($remote, '/').$endpoint.'/'.$remoteId.'/'.$feedback.'?format='.\OCP\Share::RESPONSE_FORMAT; |
|
| 301 | 301 | $fields = array('token' => $token); |
| 302 | 302 | |
| 303 | 303 | $client = $this->clientService->newClient(); |
@@ -354,13 +354,13 @@ discard block |
||
| 354 | 354 | * @return string |
| 355 | 355 | */ |
| 356 | 356 | protected function stripPath($path) { |
| 357 | - $prefix = '/' . $this->uid . '/files'; |
|
| 357 | + $prefix = '/'.$this->uid.'/files'; |
|
| 358 | 358 | return rtrim(substr($path, strlen($prefix)), '/'); |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | public function getMount($data) { |
| 362 | 362 | $data['manager'] = $this; |
| 363 | - $mountPoint = '/' . $this->uid . '/files' . $data['mountpoint']; |
|
| 363 | + $mountPoint = '/'.$this->uid.'/files'.$data['mountpoint']; |
|
| 364 | 364 | $data['mountpoint'] = $mountPoint; |
| 365 | 365 | $data['certificateManager'] = \OC::$server->getCertificateManager($this->uid); |
| 366 | 366 | return new Mount(self::STORAGE, $mountPoint, $data, $this, $this->storageLoader); |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | WHERE `mountpoint_hash` = ? |
| 401 | 401 | AND `user` = ? |
| 402 | 402 | '); |
| 403 | - $result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid)); |
|
| 403 | + $result = (bool) $query->execute(array($target, $targetHash, $sourceHash, $this->uid)); |
|
| 404 | 404 | |
| 405 | 405 | return $result; |
| 406 | 406 | } |
@@ -435,9 +435,9 @@ discard block |
||
| 435 | 435 | WHERE `mountpoint_hash` = ? |
| 436 | 436 | AND `user` = ? |
| 437 | 437 | '); |
| 438 | - $result = (bool)$query->execute(array($hash, $this->uid)); |
|
| 438 | + $result = (bool) $query->execute(array($hash, $this->uid)); |
|
| 439 | 439 | |
| 440 | - if($result) { |
|
| 440 | + if ($result) { |
|
| 441 | 441 | $this->removeReShares($id); |
| 442 | 442 | } |
| 443 | 443 | |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | |
| 459 | 459 | |
| 460 | 460 | $query->delete('federated_reshares') |
| 461 | - ->where($query->expr()->in('share_id', $query->createFunction('(' . $select . ')'))); |
|
| 461 | + ->where($query->expr()->in('share_id', $query->createFunction('('.$select.')'))); |
|
| 462 | 462 | $query->execute(); |
| 463 | 463 | |
| 464 | 464 | $deleteReShares = $this->connection->getQueryBuilder(); |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | |
| 483 | 483 | if ($result) { |
| 484 | 484 | $shares = $getShare->fetchAll(); |
| 485 | - foreach($shares as $share) { |
|
| 485 | + foreach ($shares as $share) { |
|
| 486 | 486 | $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline'); |
| 487 | 487 | } |
| 488 | 488 | } |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | DELETE FROM `*PREFIX*share_external` |
| 492 | 492 | WHERE `user` = ? |
| 493 | 493 | '); |
| 494 | - return (bool)$query->execute(array($uid)); |
|
| 494 | + return (bool) $query->execute(array($uid)); |
|
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | /** |