@@ -323,7 +323,7 @@ |
||
323 | 323 | * @return int Check unique ID |
324 | 324 | */ |
325 | 325 | protected function addCheck($class, $operator, $value) { |
326 | - $hash = md5($class . '::' . $operator . '::' . $value); |
|
326 | + $hash = md5($class.'::'.$operator.'::'.$value); |
|
327 | 327 | |
328 | 328 | $query = $this->connection->getQueryBuilder(); |
329 | 329 | $query->select('id') |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $node = \OC::$server->getRootFolder() |
88 | 88 | ->getUserFolder($parameters['user']) |
89 | 89 | ->get($this->request->getParam('path')); |
90 | - return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/')); |
|
90 | + return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/')); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | try { |
122 | 122 | $lockingProvider->acquireLock($path, $type); |
123 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
123 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
124 | 124 | return new \OC_OCS_Result(null, 100); |
125 | 125 | } catch (LockedException $e) { |
126 | 126 | return new \OC_OCS_Result(null, Http::STATUS_LOCKED); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | try { |
147 | 147 | $lockingProvider->changeLock($path, $type); |
148 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
148 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
149 | 149 | return new \OC_OCS_Result(null, 100); |
150 | 150 | } catch (LockedException $e) { |
151 | 151 | return new \OC_OCS_Result(null, Http::STATUS_LOCKED); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | try { |
172 | 172 | $lockingProvider->releaseLock($path, $type); |
173 | - $this->config->deleteAppValue('testing', 'locking_' . $path); |
|
173 | + $this->config->deleteAppValue('testing', 'locking_'.$path); |
|
174 | 174 | return new \OC_OCS_Result(null, 100); |
175 | 175 | } catch (LockedException $e) { |
176 | 176 | return new \OC_OCS_Result(null, Http::STATUS_LOCKED); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | use OCA\Testing\AlternativeHomeUserBackend; |
26 | 26 | |
27 | 27 | class Application extends App { |
28 | - public function __construct (array $urlParams = array()) { |
|
28 | + public function __construct(array $urlParams = array()) { |
|
29 | 29 | $appName = 'testing'; |
30 | 30 | parent::__construct($appName, $urlParams); |
31 | 31 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | if ($uid !== 'admin') { |
49 | 49 | $uid = md5($uid); |
50 | 50 | } |
51 | - return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid; |
|
51 | + return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return false; |
@@ -5,16 +5,16 @@ discard block |
||
5 | 5 | ?> |
6 | 6 | |
7 | 7 | <div id="fileSharingSettings" class="followupsection"> |
8 | - <h3><?php p($l->t('Federated Cloud Sharing'));?></h3> |
|
8 | + <h3><?php p($l->t('Federated Cloud Sharing')); ?></h3> |
|
9 | 9 | <a target="_blank" rel="noreferrer" class="icon-info svg" |
10 | - title="<?php p($l->t('Open documentation'));?>" |
|
10 | + title="<?php p($l->t('Open documentation')); ?>" |
|
11 | 11 | href="<?php p(link_to_docs('admin-sharing-federated')); ?>"></a> |
12 | 12 | |
13 | 13 | <p> |
14 | 14 | <input type="checkbox" name="outgoing_server2server_share_enabled" id="outgoingServer2serverShareEnabled" class="checkbox" |
15 | 15 | value="1" <?php if ($_['outgoingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> |
16 | 16 | <label for="outgoingServer2serverShareEnabled"> |
17 | - <?php p($l->t('Allow users on this server to send shares to other servers'));?> |
|
17 | + <?php p($l->t('Allow users on this server to send shares to other servers')); ?> |
|
18 | 18 | </label> |
19 | 19 | </p> |
20 | 20 | |
@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | <input type="checkbox" name="incoming_server2server_share_enabled" id="incomingServer2serverShareEnabled" class="checkbox" |
23 | 23 | value="1" <?php if ($_['incomingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> /> |
24 | 24 | <label for="incomingServer2serverShareEnabled"> |
25 | - <?php p($l->t('Allow users on this server to receive shares from other servers'));?> |
|
25 | + <?php p($l->t('Allow users on this server to receive shares from other servers')); ?> |
|
26 | 26 | </label><br/> |
27 | 27 | </p> |
28 | 28 | <p> |
29 | 29 | <input type="checkbox" name="lookupServerEnabled" id="lookupServerEnabled" class="checkbox" |
30 | 30 | value="1" <?php if ($_['lookupServerEnabled']) print_unescaped('checked="checked"'); ?> /> |
31 | 31 | <label for="lookupServerEnabled"> |
32 | - <?php p($l->t('Search global and public address book for users'));?> |
|
32 | + <?php p($l->t('Search global and public address book for users')); ?> |
|
33 | 33 | </label><br/> |
34 | 34 | </p> |
35 | 35 | </div> |
@@ -39,16 +39,16 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | $cloudID = \OC::$server->getUserSession()->getUser()->getCloudId(); |
42 | -$url = 'https://nextcloud.com/federation#' . $cloudID; |
|
42 | +$url = 'https://nextcloud.com/federation#'.$cloudID; |
|
43 | 43 | $logoPath = \OC::$server->getURLGenerator()->imagePath('core', 'logo-icon.svg'); |
44 | 44 | $theme = \OC::$server->getThemingDefaults(); |
45 | 45 | $color = $theme->getMailHeaderColor(); |
46 | 46 | $textColor = "#ffffff"; |
47 | -if(\OC::$server->getAppManager()->isEnabledForUser("theming")) { |
|
47 | +if (\OC::$server->getAppManager()->isEnabledForUser("theming")) { |
|
48 | 48 | $logoPath = $theme->getLogo(); |
49 | 49 | try { |
50 | 50 | $util = \OC::$server->query("\OCA\Theming\Util"); |
51 | - if($util->invertTextColor($color)) { |
|
51 | + if ($util->invertTextColor($color)) { |
|
52 | 52 | $textColor = "#000000"; |
53 | 53 | } |
54 | 54 | } catch (OCP\AppFramework\QueryException $e) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'remoteId' => $shareId |
134 | 134 | ); |
135 | 135 | |
136 | - $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/' . $id . '/reshare', $fields); |
|
136 | + $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/'.$id.'/reshare', $fields); |
|
137 | 137 | $status = json_decode($result['result'], true); |
138 | 138 | |
139 | 139 | $httpRequestSuccessful = $result['success']; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | if ($httpRequestSuccessful && $ocsCallSuccessful && $validToken && $validRemoteId) { |
145 | 145 | return [ |
146 | 146 | $status['ocs']['data']['token'], |
147 | - (int)$status['ocs']['data']['remoteId'] |
|
147 | + (int) $status['ocs']['data']['remoteId'] |
|
148 | 148 | ]; |
149 | 149 | } |
150 | 150 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $fields[$key] = $value; |
229 | 229 | } |
230 | 230 | |
231 | - $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/' . $remoteId . '/' . $action, $fields); |
|
231 | + $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/'.$remoteId.'/'.$action, $fields); |
|
232 | 232 | $status = json_decode($result['result'], true); |
233 | 233 | |
234 | 234 | if ($result['success'] && |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $client = $this->httpClientService->newClient(); |
280 | 280 | |
281 | 281 | if ($this->addressHandler->urlContainProtocol($remoteDomain) === false) { |
282 | - $remoteDomain = 'https://' . $remoteDomain; |
|
282 | + $remoteDomain = 'https://'.$remoteDomain; |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | $result = [ |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | $endpoint = $this->discoveryManager->getShareEndpoint($remoteDomain); |
291 | 291 | try { |
292 | - $response = $client->post($remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [ |
|
292 | + $response = $client->post($remoteDomain.$endpoint.$urlSuffix.'?format='.self::RESPONSE_FORMAT, [ |
|
293 | 293 | 'body' => $fields, |
294 | 294 | 'timeout' => 10, |
295 | 295 | 'connect_timeout' => 10, |
@@ -184,12 +184,12 @@ |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | try { |
187 | - $this->getDisplayNameFromContact($user . '@http://' . $server); |
|
187 | + $this->getDisplayNameFromContact($user.'@http://'.$server); |
|
188 | 188 | } catch (\OutOfBoundsException $e) { |
189 | 189 | } |
190 | 190 | |
191 | 191 | try { |
192 | - $this->getDisplayNameFromContact($user . '@https://' . $server); |
|
192 | + $this->getDisplayNameFromContact($user.'@https://'.$server); |
|
193 | 193 | } catch (\OutOfBoundsException $e) { |
194 | 194 | } |
195 | 195 |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if ($remoteShare) { |
183 | 183 | try { |
184 | 184 | $ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']); |
185 | - $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time()); |
|
185 | + $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time()); |
|
186 | 186 | $share->setId($shareId); |
187 | 187 | list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId); |
188 | 188 | // remote share was create successfully if we get a valid token as return |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | $failure = true; |
255 | 255 | } |
256 | 256 | } catch (\Exception $e) { |
257 | - $this->logger->error('Failed to notify remote server of federated share, removing share (' . $e->getMessage() . ')'); |
|
257 | + $this->logger->error('Failed to notify remote server of federated share, removing share ('.$e->getMessage().')'); |
|
258 | 258 | $failure = true; |
259 | 259 | } |
260 | 260 | |
261 | - if($failure) { |
|
261 | + if ($failure) { |
|
262 | 262 | $this->removeShareFromTableById($shareId); |
263 | 263 | $message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable or uses a self-signed certificate.', |
264 | 264 | [$share->getNode()->getName(), $share->getSharedWith()]); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | ->andWhere($query->expr()->eq('mountpoint', $query->createNamedParameter($share->getTarget()))); |
310 | 310 | $result = $query->execute()->fetchAll(); |
311 | 311 | |
312 | - if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) { |
|
312 | + if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) { |
|
313 | 313 | return $result[0]; |
314 | 314 | } |
315 | 315 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $qb->execute(); |
352 | 352 | $id = $qb->getLastInsertId(); |
353 | 353 | |
354 | - return (int)$id; |
|
354 | + return (int) $id; |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
@@ -441,14 +441,14 @@ discard block |
||
441 | 441 | public function getRemoteId(IShare $share) { |
442 | 442 | $query = $this->dbConnection->getQueryBuilder(); |
443 | 443 | $query->select('remote_id')->from('federated_reshares') |
444 | - ->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId()))); |
|
444 | + ->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId()))); |
|
445 | 445 | $data = $query->execute()->fetch(); |
446 | 446 | |
447 | 447 | if (!is_array($data) || !isset($data['remote_id'])) { |
448 | 448 | throw new ShareNotFound(); |
449 | 449 | } |
450 | 450 | |
451 | - return (int)$data['remote_id']; |
|
451 | + return (int) $data['remote_id']; |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | /** |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | ->orderBy('id'); |
480 | 480 | |
481 | 481 | $cursor = $qb->execute(); |
482 | - while($data = $cursor->fetch()) { |
|
482 | + while ($data = $cursor->fetch()) { |
|
483 | 483 | $children[] = $this->createShareObject($data); |
484 | 484 | } |
485 | 485 | $cursor->closeCursor(); |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | ); |
609 | 609 | } |
610 | 610 | |
611 | - $qb->innerJoin('s', 'filecache' ,'f', 's.file_source = f.fileid'); |
|
611 | + $qb->innerJoin('s', 'filecache', 'f', 's.file_source = f.fileid'); |
|
612 | 612 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
613 | 613 | |
614 | 614 | $qb->orderBy('id'); |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | |
672 | 672 | $cursor = $qb->execute(); |
673 | 673 | $shares = []; |
674 | - while($data = $cursor->fetch()) { |
|
674 | + while ($data = $cursor->fetch()) { |
|
675 | 675 | $shares[] = $this->createShareObject($data); |
676 | 676 | } |
677 | 677 | $cursor->closeCursor(); |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | ->execute(); |
724 | 724 | |
725 | 725 | $shares = []; |
726 | - while($data = $cursor->fetch()) { |
|
726 | + while ($data = $cursor->fetch()) { |
|
727 | 727 | $shares[] = $this->createShareObject($data); |
728 | 728 | } |
729 | 729 | $cursor->closeCursor(); |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | |
763 | 763 | $cursor = $qb->execute(); |
764 | 764 | |
765 | - while($data = $cursor->fetch()) { |
|
765 | + while ($data = $cursor->fetch()) { |
|
766 | 766 | $shares[] = $this->createShareObject($data); |
767 | 767 | } |
768 | 768 | $cursor->closeCursor(); |
@@ -839,15 +839,15 @@ discard block |
||
839 | 839 | private function createShareObject($data) { |
840 | 840 | |
841 | 841 | $share = new Share($this->rootFolder, $this->userManager); |
842 | - $share->setId((int)$data['id']) |
|
843 | - ->setShareType((int)$data['share_type']) |
|
844 | - ->setPermissions((int)$data['permissions']) |
|
842 | + $share->setId((int) $data['id']) |
|
843 | + ->setShareType((int) $data['share_type']) |
|
844 | + ->setPermissions((int) $data['permissions']) |
|
845 | 845 | ->setTarget($data['file_target']) |
846 | - ->setMailSend((bool)$data['mail_send']) |
|
846 | + ->setMailSend((bool) $data['mail_send']) |
|
847 | 847 | ->setToken($data['token']); |
848 | 848 | |
849 | 849 | $shareTime = new \DateTime(); |
850 | - $shareTime->setTimestamp((int)$data['stime']); |
|
850 | + $shareTime->setTimestamp((int) $data['stime']); |
|
851 | 851 | $share->setShareTime($shareTime); |
852 | 852 | $share->setSharedWith($data['share_with']); |
853 | 853 | |
@@ -857,13 +857,13 @@ discard block |
||
857 | 857 | } else { |
858 | 858 | //OLD SHARE |
859 | 859 | $share->setSharedBy($data['uid_owner']); |
860 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
860 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
861 | 861 | |
862 | 862 | $owner = $path->getOwner(); |
863 | 863 | $share->setShareOwner($owner->getUID()); |
864 | 864 | } |
865 | 865 | |
866 | - $share->setNodeId((int)$data['file_source']); |
|
866 | + $share->setNodeId((int) $data['file_source']); |
|
867 | 867 | $share->setNodeType($data['item_type']); |
868 | 868 | |
869 | 869 | $share->setProviderId($this->identifier()); |