@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if ($remoteShare) { |
| 194 | 194 | try { |
| 195 | 195 | $ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']); |
| 196 | - $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time()); |
|
| 196 | + $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time()); |
|
| 197 | 197 | $share->setId($shareId); |
| 198 | 198 | list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId); |
| 199 | 199 | // remote share was create successfully if we get a valid token as return |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $failure = true; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - if($failure) { |
|
| 276 | + if ($failure) { |
|
| 277 | 277 | $this->removeShareFromTableById($shareId); |
| 278 | 278 | $message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable or uses a self-signed certificate.', |
| 279 | 279 | [$share->getNode()->getName(), $share->getSharedWith()]); |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | ->andWhere($query->expr()->eq('mountpoint', $query->createNamedParameter($share->getTarget()))); |
| 325 | 325 | $result = $query->execute()->fetchAll(); |
| 326 | 326 | |
| 327 | - if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) { |
|
| 327 | + if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) { |
|
| 328 | 328 | return $result[0]; |
| 329 | 329 | } |
| 330 | 330 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $qb->execute(); |
| 367 | 367 | $id = $qb->getLastInsertId(); |
| 368 | 368 | |
| 369 | - return (int)$id; |
|
| 369 | + return (int) $id; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
@@ -456,14 +456,14 @@ discard block |
||
| 456 | 456 | public function getRemoteId(IShare $share) { |
| 457 | 457 | $query = $this->dbConnection->getQueryBuilder(); |
| 458 | 458 | $query->select('remote_id')->from('federated_reshares') |
| 459 | - ->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId()))); |
|
| 459 | + ->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId()))); |
|
| 460 | 460 | $data = $query->execute()->fetch(); |
| 461 | 461 | |
| 462 | 462 | if (!is_array($data) || !isset($data['remote_id'])) { |
| 463 | 463 | throw new ShareNotFound(); |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | - return (int)$data['remote_id']; |
|
| 466 | + return (int) $data['remote_id']; |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | ->orderBy('id'); |
| 495 | 495 | |
| 496 | 496 | $cursor = $qb->execute(); |
| 497 | - while($data = $cursor->fetch()) { |
|
| 497 | + while ($data = $cursor->fetch()) { |
|
| 498 | 498 | $children[] = $this->createShareObject($data); |
| 499 | 499 | } |
| 500 | 500 | $cursor->closeCursor(); |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | ); |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 625 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 626 | 626 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 627 | 627 | |
| 628 | 628 | $qb->orderBy('id'); |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | |
| 686 | 686 | $cursor = $qb->execute(); |
| 687 | 687 | $shares = []; |
| 688 | - while($data = $cursor->fetch()) { |
|
| 688 | + while ($data = $cursor->fetch()) { |
|
| 689 | 689 | $shares[] = $this->createShareObject($data); |
| 690 | 690 | } |
| 691 | 691 | $cursor->closeCursor(); |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | $cursor->closeCursor(); |
| 710 | 710 | |
| 711 | 711 | if ($data === false) { |
| 712 | - throw new ShareNotFoundException('Can not find share with ID: ' . $id); |
|
| 712 | + throw new ShareNotFoundException('Can not find share with ID: '.$id); |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | try { |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | ->execute(); |
| 738 | 738 | |
| 739 | 739 | $shares = []; |
| 740 | - while($data = $cursor->fetch()) { |
|
| 740 | + while ($data = $cursor->fetch()) { |
|
| 741 | 741 | $shares[] = $this->createShareObject($data); |
| 742 | 742 | } |
| 743 | 743 | $cursor->closeCursor(); |
@@ -776,7 +776,7 @@ discard block |
||
| 776 | 776 | |
| 777 | 777 | $cursor = $qb->execute(); |
| 778 | 778 | |
| 779 | - while($data = $cursor->fetch()) { |
|
| 779 | + while ($data = $cursor->fetch()) { |
|
| 780 | 780 | $shares[] = $this->createShareObject($data); |
| 781 | 781 | } |
| 782 | 782 | $cursor->closeCursor(); |
@@ -853,15 +853,15 @@ discard block |
||
| 853 | 853 | private function createShareObject($data) { |
| 854 | 854 | |
| 855 | 855 | $share = new Share($this->rootFolder, $this->userManager); |
| 856 | - $share->setId((int)$data['id']) |
|
| 857 | - ->setShareType((int)$data['share_type']) |
|
| 858 | - ->setPermissions((int)$data['permissions']) |
|
| 856 | + $share->setId((int) $data['id']) |
|
| 857 | + ->setShareType((int) $data['share_type']) |
|
| 858 | + ->setPermissions((int) $data['permissions']) |
|
| 859 | 859 | ->setTarget($data['file_target']) |
| 860 | - ->setMailSend((bool)$data['mail_send']) |
|
| 860 | + ->setMailSend((bool) $data['mail_send']) |
|
| 861 | 861 | ->setToken($data['token']); |
| 862 | 862 | |
| 863 | 863 | $shareTime = new \DateTime(); |
| 864 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 864 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 865 | 865 | $share->setShareTime($shareTime); |
| 866 | 866 | $share->setSharedWith($data['share_with']); |
| 867 | 867 | |
@@ -871,13 +871,13 @@ discard block |
||
| 871 | 871 | } else { |
| 872 | 872 | //OLD SHARE |
| 873 | 873 | $share->setSharedBy($data['uid_owner']); |
| 874 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
| 874 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
| 875 | 875 | |
| 876 | 876 | $owner = $path->getOwner(); |
| 877 | 877 | $share->setShareOwner($owner->getUID()); |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | - $share->setNodeId((int)$data['file_source']); |
|
| 880 | + $share->setNodeId((int) $data['file_source']); |
|
| 881 | 881 | $share->setNodeType($data['item_type']); |
| 882 | 882 | |
| 883 | 883 | $share->setProviderId($this->identifier()); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | if (!$this->userManager->userExists($shareWith)) { |
| 152 | 152 | return new JSONResponse( |
| 153 | - ['message' => 'User "' . $shareWith . '" does not exists at ' . $this->urlGenerator->getBaseUrl()], |
|
| 153 | + ['message' => 'User "'.$shareWith.'" does not exists at '.$this->urlGenerator->getBaseUrl()], |
|
| 154 | 154 | Http::STATUS_BAD_REQUEST |
| 155 | 155 | ); |
| 156 | 156 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | ); |
| 183 | 183 | } catch (\Exception $e) { |
| 184 | 184 | return new JSONResponse( |
| 185 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
| 185 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
| 186 | 186 | Http::STATUS_BAD_REQUEST |
| 187 | 187 | ); |
| 188 | 188 | } |
@@ -251,12 +251,12 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | catch (\Exception $e) { |
| 253 | 253 | return new JSONResponse( |
| 254 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
| 254 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
| 255 | 255 | Http::STATUS_BAD_REQUEST |
| 256 | 256 | ); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - return new JSONResponse($result,Http::STATUS_CREATED); |
|
| 259 | + return new JSONResponse($result, Http::STATUS_CREATED); |
|
| 260 | 260 | |
| 261 | 261 | } |
| 262 | 262 | |
@@ -269,13 +269,13 @@ discard block |
||
| 269 | 269 | private function mapUid($uid) { |
| 270 | 270 | \OC::$server->getURLGenerator()->linkToDocs('key'); |
| 271 | 271 | // FIXME this should be a method in the user management instead |
| 272 | - $this->logger->debug('shareWith before, ' . $uid, ['app' => $this->appName]); |
|
| 272 | + $this->logger->debug('shareWith before, '.$uid, ['app' => $this->appName]); |
|
| 273 | 273 | \OCP\Util::emitHook( |
| 274 | 274 | '\OCA\Files_Sharing\API\Server2Server', |
| 275 | 275 | 'preLoginNameUsedAsUserName', |
| 276 | 276 | array('uid' => &$uid) |
| 277 | 277 | ); |
| 278 | - $this->logger->debug('shareWith after, ' . $uid, ['app' => $this->appName]); |
|
| 278 | + $this->logger->debug('shareWith after, '.$uid, ['app' => $this->appName]); |
|
| 279 | 279 | |
| 280 | 280 | return $uid; |
| 281 | 281 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $ocsStatus = isset($status['ocs']); |
| 118 | 118 | $ocsSuccess = $ocsStatus && ($status['ocs']['meta']['statuscode'] === 100 || $status['ocs']['meta']['statuscode'] === 200); |
| 119 | 119 | |
| 120 | - if ($result['success'] && (!$ocsStatus ||$ocsSuccess)) { |
|
| 120 | + if ($result['success'] && (!$ocsStatus || $ocsSuccess)) { |
|
| 121 | 121 | \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $remote]); |
| 122 | 122 | return true; |
| 123 | 123 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | return [$ocmResult['token'], $ocmResult['providerId']]; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $result = $this->tryLegacyEndPoint(rtrim($remote, '/'), '/' . $id . '/reshare', $fields); |
|
| 163 | + $result = $this->tryLegacyEndPoint(rtrim($remote, '/'), '/'.$id.'/reshare', $fields); |
|
| 164 | 164 | $status = json_decode($result['result'], true); |
| 165 | 165 | |
| 166 | 166 | $httpRequestSuccessful = $result['success']; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if ($httpRequestSuccessful && $ocsCallSuccessful && $validToken && $validRemoteId) { |
| 172 | 172 | return [ |
| 173 | 173 | $status['ocs']['data']['token'], |
| 174 | - (int)$status['ocs']['data']['remoteId'] |
|
| 174 | + (int) $status['ocs']['data']['remoteId'] |
|
| 175 | 175 | ]; |
| 176 | 176 | } |
| 177 | 177 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $fields[$key] = $value; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/' . $remoteId . '/' . $action, $fields, $action); |
|
| 261 | + $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/'.$remoteId.'/'.$action, $fields, $action); |
|
| 262 | 262 | $status = json_decode($result['result'], true); |
| 263 | 263 | |
| 264 | 264 | if ($result['success'] && |
@@ -306,10 +306,10 @@ discard block |
||
| 306 | 306 | * @return array |
| 307 | 307 | * @throws \Exception |
| 308 | 308 | */ |
| 309 | - protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $action="share") { |
|
| 309 | + protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $action = "share") { |
|
| 310 | 310 | |
| 311 | 311 | if ($this->addressHandler->urlContainProtocol($remoteDomain) === false) { |
| 312 | - $remoteDomain = 'https://' . $remoteDomain; |
|
| 312 | + $remoteDomain = 'https://'.$remoteDomain; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | $result = [ |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $federationEndpoints = $this->discoveryService->discover($remoteDomain, 'FEDERATED_SHARING'); |
| 349 | 349 | $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; |
| 350 | 350 | try { |
| 351 | - $response = $client->post($remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [ |
|
| 351 | + $response = $client->post($remoteDomain.$endpoint.$urlSuffix.'?format='.self::RESPONSE_FORMAT, [ |
|
| 352 | 352 | 'body' => $fields, |
| 353 | 353 | 'timeout' => 10, |
| 354 | 354 | 'connect_timeout' => 10, |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | switch ($action) { |
| 406 | 406 | case 'share': |
| 407 | 407 | $share = $this->cloudFederationFactory->getCloudFederationShare( |
| 408 | - $fields['shareWith'] . '@' . $remoteDomain, |
|
| 408 | + $fields['shareWith'].'@'.$remoteDomain, |
|
| 409 | 409 | $fields['name'], |
| 410 | 410 | '', |
| 411 | 411 | $fields['remoteId'], |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $owner = isset($_POST['owner']) ? $_POST['owner'] : null; |
| 150 | 150 | $sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null; |
| 151 | 151 | $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null; |
| 152 | - $remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null; |
|
| 152 | + $remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null; |
|
| 153 | 153 | $sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null; |
| 154 | 154 | $ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null; |
| 155 | 155 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } catch (ProviderCouldNotAddShareException $e) { |
| 185 | 185 | throw new OCSException($e->getMessage(), $e->getCode()); |
| 186 | 186 | } catch (\Exception $e) { |
| 187 | - throw new OCSException('internal server error, was not able to add share from ' . $remote, 500); |
|
| 187 | + throw new OCSException('internal server error, was not able to add share from '.$remote, 500); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | return new Http\DataResponse(); |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | $token = $this->request->getParam('token', null); |
| 208 | 208 | $shareWith = $this->request->getParam('shareWith', null); |
| 209 | - $permission = (int)$this->request->getParam('permission', null); |
|
| 210 | - $remoteId = (int)$this->request->getParam('remoteId', null); |
|
| 209 | + $permission = (int) $this->request->getParam('permission', null); |
|
| 210 | + $remoteId = (int) $this->request->getParam('remoteId', null); |
|
| 211 | 211 | |
| 212 | 212 | if ($id === null || |
| 213 | 213 | $token === null || |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | } catch (ProviderDoesNotExistsException $e) { |
| 236 | 236 | throw new OCSException('Server does not support federated cloud sharing', 503); |
| 237 | 237 | } catch (ShareNotFoundException $e) { |
| 238 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
| 238 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
| 239 | 239 | } catch (ProviderCouldNotAddShareException $e) { |
| 240 | - $this->logger->debug('Could not add reshare: ' . $e->getMessage()); |
|
| 240 | + $this->logger->debug('Could not add reshare: '.$e->getMessage()); |
|
| 241 | 241 | throw new OCSForbiddenException(); |
| 242 | 242 | } catch (\Exception $e) { |
| 243 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
| 243 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | throw new OCSBadRequestException(); |
@@ -274,9 +274,9 @@ discard block |
||
| 274 | 274 | } catch (ProviderDoesNotExistsException $e) { |
| 275 | 275 | throw new OCSException('Server does not support federated cloud sharing', 503); |
| 276 | 276 | } catch (ShareNotFoundException $e) { |
| 277 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
| 277 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
| 278 | 278 | } catch (\Exception $e) { |
| 279 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
| 279 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | return new Http\DataResponse(); |
@@ -307,9 +307,9 @@ discard block |
||
| 307 | 307 | } catch (ProviderDoesNotExistsException $e) { |
| 308 | 308 | throw new OCSException('Server does not support federated cloud sharing', 503); |
| 309 | 309 | } catch (ShareNotFoundException $e) { |
| 310 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
| 310 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
| 311 | 311 | } catch (\Exception $e) { |
| 312 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
| 312 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | return new Http\DataResponse(); |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | $notification = ['sharedSecret' => $token]; |
| 339 | 339 | $provider->notificationReceived('SHARE_UNSHARED', $id, $notification); |
| 340 | 340 | } catch (\Exception $e) { |
| 341 | - $this->logger->debug('processing unshare notification failed: ' . $e->getMessage()); |
|
| 341 | + $this->logger->debug('processing unshare notification failed: '.$e->getMessage()); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | return new Http\DataResponse(); |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | $validPermission = ctype_digit($permissions); |
| 466 | 466 | $validToken = $this->verifyShare($share, $token); |
| 467 | 467 | if ($validPermission && $validToken) { |
| 468 | - $this->updatePermissionsInDatabase($share, (int)$permissions); |
|
| 468 | + $this->updatePermissionsInDatabase($share, (int) $permissions); |
|
| 469 | 469 | } else { |
| 470 | 470 | throw new OCSBadRequestException(); |
| 471 | 471 | } |
@@ -188,16 +188,16 @@ discard block |
||
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | // FIXME this should be a method in the user management instead |
| 191 | - $this->logger->debug('shareWith before, ' . $shareWith, ['app' => 'files_sharing']); |
|
| 191 | + $this->logger->debug('shareWith before, '.$shareWith, ['app' => 'files_sharing']); |
|
| 192 | 192 | Util::emitHook( |
| 193 | 193 | '\OCA\Files_Sharing\API\Server2Server', |
| 194 | 194 | 'preLoginNameUsedAsUserName', |
| 195 | 195 | array('uid' => &$shareWith) |
| 196 | 196 | ); |
| 197 | - $this->logger->debug('shareWith after, ' . $shareWith, ['app' => 'files_sharing']); |
|
| 197 | + $this->logger->debug('shareWith after, '.$shareWith, ['app' => 'files_sharing']); |
|
| 198 | 198 | |
| 199 | 199 | if (!$this->userManager->userExists($shareWith)) { |
| 200 | - throw new ProviderCouldNotAddShareException('User does not exists', '',Http::STATUS_BAD_REQUEST); |
|
| 200 | + throw new ProviderCouldNotAddShareException('User does not exists', '', Http::STATUS_BAD_REQUEST); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | \OC_Util::setupFS($shareWith); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | ->setType('remote_share') |
| 224 | 224 | ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')]) |
| 225 | 225 | ->setAffectedUser($shareWith) |
| 226 | - ->setObject('remote_share', (int)$shareId, $name); |
|
| 226 | + ->setObject('remote_share', (int) $shareId, $name); |
|
| 227 | 227 | \OC::$server->getActivityManager()->publish($event); |
| 228 | 228 | |
| 229 | 229 | $notification = $this->notificationManager->createNotification(); |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | $declineAction = $notification->createAction(); |
| 237 | 237 | $declineAction->setLabel('decline') |
| 238 | - ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'DELETE'); |
|
| 238 | + ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'DELETE'); |
|
| 239 | 239 | $notification->addAction($declineAction); |
| 240 | 240 | |
| 241 | 241 | $acceptAction = $notification->createAction(); |
| 242 | 242 | $acceptAction->setLabel('accept') |
| 243 | - ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'POST'); |
|
| 243 | + ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'POST'); |
|
| 244 | 244 | $notification->addAction($acceptAction); |
| 245 | 245 | |
| 246 | 246 | $this->notificationManager->notify($notification); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | 'level' => Util::ERROR, |
| 253 | 253 | 'app' => 'files_sharing' |
| 254 | 254 | ]); |
| 255 | - throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from ' . $remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR); |
|
| 255 | + throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from '.$remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR); |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | protected function executeAcceptShare(IShare $share) { |
| 351 | 351 | try { |
| 352 | - $fileId = (int)$share->getNode()->getId(); |
|
| 352 | + $fileId = (int) $share->getNode()->getId(); |
|
| 353 | 353 | list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); |
| 354 | 354 | } catch (\Exception $e) { |
| 355 | 355 | throw new ShareNotFoundException(); |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | $this->federatedShareProvider->removeShareFromTable($share); |
| 429 | 429 | |
| 430 | 430 | try { |
| 431 | - $fileId = (int)$share->getNode()->getId(); |
|
| 431 | + $fileId = (int) $share->getNode()->getId(); |
|
| 432 | 432 | list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); |
| 433 | 433 | } catch (\Exception $e) { |
| 434 | 434 | throw new ShareNotFoundException(); |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $notification = $this->notificationManager->createNotification(); |
| 523 | 523 | $notification->setApp('files_sharing') |
| 524 | 524 | ->setUser($share['user']) |
| 525 | - ->setObject('remote_share', (int)$share['id']); |
|
| 525 | + ->setObject('remote_share', (int) $share['id']); |
|
| 526 | 526 | $this->notificationManager->markProcessed($notification); |
| 527 | 527 | |
| 528 | 528 | $event = $this->activityManager->generateEvent(); |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | ->setType('remote_share') |
| 531 | 531 | ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path]) |
| 532 | 532 | ->setAffectedUser($user) |
| 533 | - ->setObject('remote_share', (int)$share['id'], $path); |
|
| 533 | + ->setObject('remote_share', (int) $share['id'], $path); |
|
| 534 | 534 | \OC::$server->getActivityManager()->publish($event); |
| 535 | 535 | } |
| 536 | 536 | |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | $owner = $share->getShareOwner(); |
| 580 | 580 | $currentServer = $this->addressHandler->generateRemoteURL(); |
| 581 | 581 | if ($this->addressHandler->compareAddresses($user, $remote, $owner, $currentServer)) { |
| 582 | - throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: ' . $id); |
|
| 582 | + throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: '.$id); |
|
| 583 | 583 | } |
| 584 | 584 | } catch (\Exception $e) { |
| 585 | 585 | throw new ProviderCouldNotAddShareException($e->getMessage()); |
@@ -593,10 +593,10 @@ discard block |
||
| 593 | 593 | $share->setSharedBy($share->getSharedWith()); |
| 594 | 594 | $share->setSharedWith($shareWith); |
| 595 | 595 | $result = $this->federatedShareProvider->create($share); |
| 596 | - $this->federatedShareProvider->storeRemoteId((int)$result->getId(), $senderId); |
|
| 596 | + $this->federatedShareProvider->storeRemoteId((int) $result->getId(), $senderId); |
|
| 597 | 597 | return ['token' => $result->getToken(), 'providerId' => $result->getId()]; |
| 598 | 598 | } else { |
| 599 | - throw new ProviderCouldNotAddShareException('resharing not allowed for share: ' . $id); |
|
| 599 | + throw new ProviderCouldNotAddShareException('resharing not allowed for share: '.$id); |
|
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | throw new BadRequestException([]); |