@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | // Check if the target user exists |
87 | 87 | $targetUserObject = $this->userManager->get($userId); |
88 | - if($targetUserObject === null) { |
|
88 | + if ($targetUserObject === null) { |
|
89 | 89 | throw new OCSNotFoundException('User does not exist'); |
90 | 90 | } |
91 | 91 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | protected function getUserSubAdminGroupsData(string $userId): array { |
138 | 138 | $user = $this->userManager->get($userId); |
139 | 139 | // Check if the user exists |
140 | - if($user === null) { |
|
140 | + if ($user === null) { |
|
141 | 141 | throw new OCSNotFoundException('User does not exist'); |
142 | 142 | } |
143 | 143 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | IUserSession $userSession |
64 | 64 | ) { |
65 | 65 | $this->user = $user; |
66 | - $this->isAdmin = (bool)$isAdmin; |
|
66 | + $this->isAdmin = (bool) $isAdmin; |
|
67 | 67 | $this->groupManager = $groupManager; |
68 | 68 | $this->userSession = $userSession; |
69 | 69 | } |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | * @return array |
80 | 80 | */ |
81 | 81 | public function get($groupSearch = '', $userSearch = '') { |
82 | - $key = $groupSearch . '::' . $userSearch; |
|
83 | - if(isset($this->metaData[$key])) { |
|
82 | + $key = $groupSearch.'::'.$userSearch; |
|
83 | + if (isset($this->metaData[$key])) { |
|
84 | 84 | return $this->metaData[$key]; |
85 | 85 | } |
86 | 86 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $sortAdminGroupsIndex = 0; |
92 | 92 | $sortAdminGroupsKeys = array(); |
93 | 93 | |
94 | - foreach($this->getGroups($groupSearch) as $group) { |
|
94 | + foreach ($this->getGroups($groupSearch) as $group) { |
|
95 | 95 | $groupMetaData = $this->generateGroupMetaData($group, $userSearch); |
96 | 96 | if (strtolower($group->getGID()) !== 'admin') { |
97 | 97 | $this->addEntry( |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | * @return \OCP\IGroup[] |
190 | 190 | */ |
191 | 191 | public function getGroups($search = '') { |
192 | - if($this->isAdmin) { |
|
192 | + if ($this->isAdmin) { |
|
193 | 193 | return $this->groupManager->search($search); |
194 | 194 | } else { |
195 | 195 | $userObject = $this->userSession->getUser(); |
196 | - if($userObject !== null) { |
|
196 | + if ($userObject !== null) { |
|
197 | 197 | $groups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($userObject); |
198 | 198 | } else { |
199 | 199 | $groups = []; |
@@ -76,7 +76,7 @@ |
||
76 | 76 | ->from('dav_shares') |
77 | 77 | ->execute(); |
78 | 78 | |
79 | - while($row = $result->fetch()) { |
|
79 | + while ($row = $result->fetch()) { |
|
80 | 80 | $principaluri = $row['principaluri']; |
81 | 81 | $p = $this->principalBackend->getPrincipalByPath($principaluri); |
82 | 82 | if ($p === null) { |
@@ -129,7 +129,7 @@ |
||
129 | 129 | $data = $result->fetchAll(); |
130 | 130 | $result->closeCursor(); |
131 | 131 | |
132 | - $entities = array_map(function ($row) { |
|
132 | + $entities = array_map(function($row) { |
|
133 | 133 | return PublicKeyToken::fromRow($row); |
134 | 134 | }, $data); |
135 | 135 |
@@ -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 | } |
@@ -18,14 +18,14 @@ |
||
18 | 18 | <tr> |
19 | 19 | <th id='headerName' class="hidden column-name"> |
20 | 20 | <div id="headerName-container"> |
21 | - <a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a> |
|
21 | + <a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a> |
|
22 | 22 | </div> |
23 | 23 | </th> |
24 | 24 | <th id="headerSize" class="hidden column-size"> |
25 | 25 | <a class="size sort columntitle" data-sort="size"><span><?php p($l->t('Size')); ?></span><span class="sort-indicator"></span></a> |
26 | 26 | </th> |
27 | 27 | <th id="headerDate" class="hidden column-mtime"> |
28 | - <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Modified' )); ?></span><span class="sort-indicator"></span></a> |
|
28 | + <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t('Modified')); ?></span><span class="sort-indicator"></span></a> |
|
29 | 29 | <span class="selectedActions"> |
30 | 30 | <a href="" class="delete-selected"> |
31 | 31 | <img class="svg" alt="" |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | </th> |
30 | 30 | <th id='headerName' class="hidden column-name"> |
31 | 31 | <div id="headerName-container"> |
32 | - <a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a> |
|
32 | + <a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a> |
|
33 | 33 | <span id="selectedActionsList" class='selectedActions'> |
34 | 34 | <a href="" class="actions-selected"> |
35 | 35 | <span class="icon icon-more"></span> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | </div> |
40 | 40 | </th> |
41 | 41 | <th id="headerDate" class="hidden column-mtime"> |
42 | - <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Deleted' )); ?></span><span class="sort-indicator"></span></a> |
|
42 | + <a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t('Deleted')); ?></span><span class="sort-indicator"></span></a> |
|
43 | 43 | </th> |
44 | 44 | </tr> |
45 | 45 | </thead> |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | private function getBlobClient() { |
60 | 60 | if (!$this->blobClient) { |
61 | 61 | $protocol = $this->endpoint ? substr($this->endpoint, 0, strpos($this->endpoint, ':')) : 'https'; |
62 | - $connectionString = "DefaultEndpointsProtocol=" . $protocol . ";AccountName=" . $this->accountName . ";AccountKey=" . $this->accountKey; |
|
62 | + $connectionString = "DefaultEndpointsProtocol=".$protocol.";AccountName=".$this->accountName.";AccountKey=".$this->accountKey; |
|
63 | 63 | if ($this->endpoint) { |
64 | - $connectionString .= ';BlobEndpoint=' . $this->endpoint; |
|
64 | + $connectionString .= ';BlobEndpoint='.$this->endpoint; |
|
65 | 65 | } |
66 | 66 | $this->blobClient = BlobRestProxy::createBlobService($connectionString); |
67 | 67 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return string the container or bucket name where objects are stored |
77 | 77 | */ |
78 | 78 | public function getStorageId() { |
79 | - return 'azure::blob::' . $this->containerName; |
|
79 | + return 'azure::blob::'.$this->containerName; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -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'], |