@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function __construct($storage, array $mountpoints, $arguments = null, $loader = null) { |
67 | 67 | $this->user = $arguments['user']; |
68 | - $this->recipientView = new View('/' . $this->user . '/files'); |
|
68 | + $this->recipientView = new View('/'.$this->user.'/files'); |
|
69 | 69 | |
70 | 70 | $this->superShare = $arguments['superShare']; |
71 | 71 | $this->groupedShares = $arguments['groupedShares']; |
72 | 72 | |
73 | 73 | $newMountPoint = $this->verifyMountPoint($this->superShare, $mountpoints); |
74 | - $absMountPoint = '/' . $this->user . '/files' . $newMountPoint; |
|
75 | - $arguments['ownerView'] = new View('/' . $this->superShare->getShareOwner() . '/files'); |
|
74 | + $absMountPoint = '/'.$this->user.'/files'.$newMountPoint; |
|
75 | + $arguments['ownerView'] = new View('/'.$this->superShare->getShareOwner().'/files'); |
|
76 | 76 | parent::__construct($storage, $absMountPoint, $arguments, $loader); |
77 | 77 | } |
78 | 78 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | $newMountPoint = $this->generateUniqueTarget( |
96 | - \OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint), |
|
96 | + \OC\Files\Filesystem::normalizePath($parent.'/'.$mountPoint), |
|
97 | 97 | $this->recipientView, |
98 | 98 | $mountpoints |
99 | 99 | ); |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | */ |
131 | 131 | private function generateUniqueTarget($path, $view, array $mountpoints) { |
132 | 132 | $pathinfo = pathinfo($path); |
133 | - $ext = (isset($pathinfo['extension'])) ? '.' . $pathinfo['extension'] : ''; |
|
133 | + $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : ''; |
|
134 | 134 | $name = $pathinfo['filename']; |
135 | 135 | $dir = $pathinfo['dirname']; |
136 | 136 | |
137 | 137 | // Helper function to find existing mount points |
138 | - $mountpointExists = function ($path) use ($mountpoints) { |
|
138 | + $mountpointExists = function($path) use ($mountpoints) { |
|
139 | 139 | foreach ($mountpoints as $mountpoint) { |
140 | 140 | if ($mountpoint->getShare()->getTarget() === $path) { |
141 | 141 | return true; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | $i = 2; |
148 | 148 | while ($view->file_exists($path) || $mountpointExists($path)) { |
149 | - $path = Filesystem::normalizePath($dir . '/' . $name . ' (' . $i . ')' . $ext); |
|
149 | + $path = Filesystem::normalizePath($dir.'/'.$name.' ('.$i.')'.$ext); |
|
150 | 150 | $i++; |
151 | 151 | } |
152 | 152 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // it is not a file relative to data/user/files |
168 | 168 | if (count($split) < 3 || $split[1] !== 'files') { |
169 | 169 | \OCP\Util::writeLog('file sharing', |
170 | - 'Can not strip userid and "files/" from path: ' . $path, |
|
170 | + 'Can not strip userid and "files/" from path: '.$path, |
|
171 | 171 | \OCP\Util::ERROR); |
172 | 172 | throw new \OCA\Files_Sharing\Exceptions\BrokenPath('Path does not start with /user/files', 10); |
173 | 173 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $sliced = array_slice($split, 2); |
177 | 177 | $relPath = implode('/', $sliced); |
178 | 178 | |
179 | - return '/' . $relPath; |
|
179 | + return '/'.$relPath; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $this->storage->setMountPoint($relTargetPath); |
199 | 199 | } catch (\Exception $e) { |
200 | 200 | \OCP\Util::writeLog('file sharing', |
201 | - 'Could not rename mount point for shared folder "' . $this->getMountPoint() . '" to "' . $target . '"', |
|
201 | + 'Could not rename mount point for shared folder "'.$this->getMountPoint().'" to "'.$target.'"', |
|
202 | 202 | \OCP\Util::ERROR); |
203 | 203 | } |
204 | 204 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $row = $result->fetch(); |
254 | 254 | $result->closeCursor(); |
255 | 255 | if ($row) { |
256 | - return (int)$row['storage']; |
|
256 | + return (int) $row['storage']; |
|
257 | 257 | } |
258 | 258 | return -1; |
259 | 259 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $updatedEntries = $builder->execute(); |
73 | 73 | if ($updatedEntries > 0) { |
74 | - $out->info('Fixed file share permissions for ' . $updatedEntries . ' shares'); |
|
74 | + $out->info('Fixed file share permissions for '.$updatedEntries.' shares'); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | if ($deletedEntries) { |
110 | - $out->info('Removed ' . $deletedEntries . ' shares where the parent did not exist'); |
|
110 | + $out->info('Removed '.$deletedEntries.' shares where the parent did not exist'); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'www.google.com', |
105 | 105 | 'www.github.com']; |
106 | 106 | |
107 | - foreach($siteArray as $site) { |
|
107 | + foreach ($siteArray as $site) { |
|
108 | 108 | if ($this->isSiteReachable($site)) { |
109 | 109 | return true; |
110 | 110 | } |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | * @return bool |
118 | 118 | */ |
119 | 119 | private function isSiteReachable($sitename) { |
120 | - $httpSiteName = 'http://' . $sitename . '/'; |
|
121 | - $httpsSiteName = 'https://' . $sitename . '/'; |
|
120 | + $httpSiteName = 'http://'.$sitename.'/'; |
|
121 | + $httpsSiteName = 'https://'.$sitename.'/'; |
|
122 | 122 | |
123 | 123 | try { |
124 | 124 | $client = $this->clientService->newClient(); |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | * @return bool |
146 | 146 | */ |
147 | 147 | private function isUrandomAvailable() { |
148 | - if(@file_exists('/dev/urandom')) { |
|
148 | + if (@file_exists('/dev/urandom')) { |
|
149 | 149 | $file = fopen('/dev/urandom', 'rb'); |
150 | - if($file) { |
|
150 | + if ($file) { |
|
151 | 151 | fclose($file); |
152 | 152 | return true; |
153 | 153 | } |
@@ -178,40 +178,40 @@ discard block |
||
178 | 178 | // Don't run check when: |
179 | 179 | // 1. Server has `has_internet_connection` set to false |
180 | 180 | // 2. AppStore AND S2S is disabled |
181 | - if(!$this->config->getSystemValue('has_internet_connection', true)) { |
|
181 | + if (!$this->config->getSystemValue('has_internet_connection', true)) { |
|
182 | 182 | return ''; |
183 | 183 | } |
184 | - if(!$this->config->getSystemValue('appstoreenabled', true) |
|
184 | + if (!$this->config->getSystemValue('appstoreenabled', true) |
|
185 | 185 | && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no' |
186 | 186 | && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') { |
187 | 187 | return ''; |
188 | 188 | } |
189 | 189 | |
190 | 190 | $versionString = $this->getCurlVersion(); |
191 | - if(isset($versionString['ssl_version'])) { |
|
191 | + if (isset($versionString['ssl_version'])) { |
|
192 | 192 | $versionString = $versionString['ssl_version']; |
193 | 193 | } else { |
194 | 194 | return ''; |
195 | 195 | } |
196 | 196 | |
197 | - $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
198 | - if(!$this->config->getSystemValue('appstoreenabled', true)) { |
|
199 | - $features = (string)$this->l10n->t('Federated Cloud Sharing'); |
|
197 | + $features = (string) $this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing'); |
|
198 | + if (!$this->config->getSystemValue('appstoreenabled', true)) { |
|
199 | + $features = (string) $this->l10n->t('Federated Cloud Sharing'); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | // Check if at least OpenSSL after 1.01d or 1.0.2b |
203 | - if(strpos($versionString, 'OpenSSL/') === 0) { |
|
203 | + if (strpos($versionString, 'OpenSSL/') === 0) { |
|
204 | 204 | $majorVersion = substr($versionString, 8, 5); |
205 | 205 | $patchRelease = substr($versionString, 13, 6); |
206 | 206 | |
207 | - if(($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
207 | + if (($majorVersion === '1.0.1' && ord($patchRelease) < ord('d')) || |
|
208 | 208 | ($majorVersion === '1.0.2' && ord($patchRelease) < ord('b'))) { |
209 | 209 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['OpenSSL', $versionString, $features]); |
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | 213 | // Check if NSS and perform heuristic check |
214 | - if(strpos($versionString, 'NSS/') === 0) { |
|
214 | + if (strpos($versionString, 'NSS/') === 0) { |
|
215 | 215 | try { |
216 | 216 | $firstClient = $this->clientService->newClient(); |
217 | 217 | $firstClient->get('https://www.owncloud.org/'); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $secondClient = $this->clientService->newClient(); |
220 | 220 | $secondClient->get('https://owncloud.org/'); |
221 | 221 | } catch (ClientException $e) { |
222 | - if($e->getResponse()->getStatusCode() === 400) { |
|
222 | + if ($e->getResponse()->getStatusCode() === 400) { |
|
223 | 223 | return (string) $this->l10n->t('cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably.', ['NSS', $versionString, $features]); |
224 | 224 | } |
225 | 225 | } |
@@ -300,13 +300,13 @@ discard block |
||
300 | 300 | * @return DataResponse |
301 | 301 | */ |
302 | 302 | public function getFailedIntegrityCheckFiles() { |
303 | - if(!$this->checker->isCodeCheckEnforced()) { |
|
303 | + if (!$this->checker->isCodeCheckEnforced()) { |
|
304 | 304 | return new DataDisplayResponse('Integrity checker has been disabled. Integrity cannot be verified.'); |
305 | 305 | } |
306 | 306 | |
307 | 307 | $completeResults = $this->checker->getResults(); |
308 | 308 | |
309 | - if(!empty($completeResults)) { |
|
309 | + if (!empty($completeResults)) { |
|
310 | 310 | $formattedTextResponse = 'Technical information |
311 | 311 | ===================== |
312 | 312 | The following list covers which files have failed the integrity check. Please read |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | Results |
317 | 317 | ======= |
318 | 318 | '; |
319 | - foreach($completeResults as $context => $contextResult) { |
|
319 | + foreach ($completeResults as $context => $contextResult) { |
|
320 | 320 | $formattedTextResponse .= "- $context\n"; |
321 | 321 | |
322 | - foreach($contextResult as $category => $result) { |
|
322 | + foreach ($contextResult as $category => $result) { |
|
323 | 323 | $formattedTextResponse .= "\t- $category\n"; |
324 | - if($category !== 'EXCEPTION') { |
|
324 | + if ($category !== 'EXCEPTION') { |
|
325 | 325 | foreach ($result as $key => $results) { |
326 | 326 | $formattedTextResponse .= "\t\t- $key\n"; |
327 | 327 | } |
@@ -364,27 +364,27 @@ discard block |
||
364 | 364 | |
365 | 365 | $isOpcacheProperlySetUp = true; |
366 | 366 | |
367 | - if(!$iniWrapper->getBool('opcache.enable')) { |
|
367 | + if (!$iniWrapper->getBool('opcache.enable')) { |
|
368 | 368 | $isOpcacheProperlySetUp = false; |
369 | 369 | } |
370 | 370 | |
371 | - if(!$iniWrapper->getBool('opcache.save_comments')) { |
|
371 | + if (!$iniWrapper->getBool('opcache.save_comments')) { |
|
372 | 372 | $isOpcacheProperlySetUp = false; |
373 | 373 | } |
374 | 374 | |
375 | - if(!$iniWrapper->getBool('opcache.enable_cli')) { |
|
375 | + if (!$iniWrapper->getBool('opcache.enable_cli')) { |
|
376 | 376 | $isOpcacheProperlySetUp = false; |
377 | 377 | } |
378 | 378 | |
379 | - if($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
379 | + if ($iniWrapper->getNumeric('opcache.max_accelerated_files') < 10000) { |
|
380 | 380 | $isOpcacheProperlySetUp = false; |
381 | 381 | } |
382 | 382 | |
383 | - if($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
383 | + if ($iniWrapper->getNumeric('opcache.memory_consumption') < 128) { |
|
384 | 384 | $isOpcacheProperlySetUp = false; |
385 | 385 | } |
386 | 386 | |
387 | - if($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
387 | + if ($iniWrapper->getNumeric('opcache.interned_strings_buffer') < 8) { |
|
388 | 388 | $isOpcacheProperlySetUp = false; |
389 | 389 | } |
390 | 390 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | public function getACL() { |
102 | - $acl = [ |
|
102 | + $acl = [ |
|
103 | 103 | [ |
104 | 104 | 'privilege' => '{DAV:}read', |
105 | 105 | 'principal' => $this->getOwner(), |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'protected' => true, |
112 | 112 | ]; |
113 | 113 | if ($this->getOwner() !== parent::getOwner()) { |
114 | - $acl[] = [ |
|
114 | + $acl[] = [ |
|
115 | 115 | 'privilege' => '{DAV:}read', |
116 | 116 | 'principal' => parent::getOwner(), |
117 | 117 | 'protected' => true, |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | public function delete() { |
172 | 172 | if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { |
173 | - $principal = 'principal:' . parent::getOwner(); |
|
173 | + $principal = 'principal:'.parent::getOwner(); |
|
174 | 174 | $shares = $this->carddavBackend->getShares($this->getResourceId()); |
175 | 175 | $shares = array_filter($shares, function($share) use ($principal){ |
176 | 176 | return $share['href'] === $principal; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ], |
55 | 55 | ]; |
56 | 56 | |
57 | - if($this->appManager->isEnabledForUser('files_sharing')) { |
|
57 | + if ($this->appManager->isEnabledForUser('files_sharing')) { |
|
58 | 58 | $services['SHARING'] = [ |
59 | 59 | 'version' => 1, |
60 | 60 | 'endpoints' => [ |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - if($this->appManager->isEnabledForUser('activity')) { |
|
88 | + if ($this->appManager->isEnabledForUser('activity')) { |
|
89 | 89 | $services['ACTIVITY'] = [ |
90 | 90 | 'version' => 1, |
91 | 91 | 'endpoints' => [ |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | ]; |
95 | 95 | } |
96 | 96 | |
97 | - if($this->appManager->isEnabledForUser('provisioning_api')) { |
|
97 | + if ($this->appManager->isEnabledForUser('provisioning_api')) { |
|
98 | 98 | $services['PROVISIONING'] = [ |
99 | 99 | 'version' => 1, |
100 | 100 | 'endpoints' => [ |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $principals = []; |
84 | 84 | |
85 | 85 | if ($prefixPath === $this->principalPrefix) { |
86 | - foreach($this->userManager->search('') as $user) { |
|
86 | + foreach ($this->userManager->search('') as $user) { |
|
87 | 87 | $principals[] = $this->userToPrincipal($user); |
88 | 88 | } |
89 | 89 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $groups = $this->groupManager->getUserGroups($user); |
151 | 151 | $groups = array_map(function($group) { |
152 | 152 | /** @var IGroup $group */ |
153 | - return 'principals/groups/' . urlencode($group->getGID()); |
|
153 | + return 'principals/groups/'.urlencode($group->getGID()); |
|
154 | 154 | }, $groups); |
155 | 155 | |
156 | 156 | return $groups; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $email = substr($uri, 7); |
202 | 202 | $users = $this->userManager->getByEmail($email); |
203 | 203 | if (count($users) === 1) { |
204 | - return $this->principalPrefix . '/' . $users[0]->getUID(); |
|
204 | + return $this->principalPrefix.'/'.$users[0]->getUID(); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $userId = $user->getUID(); |
217 | 217 | $displayName = $user->getDisplayName(); |
218 | 218 | $principal = [ |
219 | - 'uri' => $this->principalPrefix . '/' . $userId, |
|
219 | + 'uri' => $this->principalPrefix.'/'.$userId, |
|
220 | 220 | '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName, |
221 | 221 | ]; |
222 | 222 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $principals = []; |
60 | 60 | |
61 | 61 | if ($prefixPath === self::PRINCIPAL_PREFIX) { |
62 | - foreach($this->groupManager->search('') as $user) { |
|
62 | + foreach ($this->groupManager->search('') as $user) { |
|
63 | 63 | $principals[] = $this->groupToPrincipal($user); |
64 | 64 | } |
65 | 65 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return array |
77 | 77 | */ |
78 | 78 | public function getPrincipalByPath($path) { |
79 | - $elements = explode('/', $path, 3); |
|
79 | + $elements = explode('/', $path, 3); |
|
80 | 80 | if ($elements[0] !== 'principals') { |
81 | 81 | return null; |
82 | 82 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | protected function groupToPrincipal($group) { |
180 | 180 | $groupId = $group->getGID(); |
181 | 181 | $principal = [ |
182 | - 'uri' => 'principals/groups/' . urlencode($groupId), |
|
182 | + 'uri' => 'principals/groups/'.urlencode($groupId), |
|
183 | 183 | '{DAV:}displayname' => $groupId, |
184 | 184 | ]; |
185 | 185 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | protected function userToPrincipal($user) { |
194 | 194 | $principal = [ |
195 | - 'uri' => 'principals/users/' . $user->getUID(), |
|
195 | + 'uri' => 'principals/users/'.$user->getUID(), |
|
196 | 196 | '{DAV:}displayname' => $user->getDisplayName(), |
197 | 197 | ]; |
198 | 198 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | <div class="warning"> |
15 | 15 | <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2> |
16 | 16 | <?php if ($error): ?> |
17 | - <?php if($error_message): ?> |
|
17 | + <?php if ($error_message): ?> |
|
18 | 18 | <p><strong><?php p($error_message); ?></strong></p> |
19 | 19 | <?php else: ?> |
20 | 20 | <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p> |
@@ -88,7 +88,7 @@ |
||
88 | 88 | if (strpos($path, '/webdav/') === 0) { |
89 | 89 | $path = substr($path, strlen('/webdav')); |
90 | 90 | } |
91 | - $path = $this->path . $path; |
|
91 | + $path = $this->path.$path; |
|
92 | 92 | $this->mimeType[$this->storage->getId()][$path] = $this->mimeTypeDetector->detectPath($path); |
93 | 93 | return $this->mimeType[$this->storage->getId()][$path]; |
94 | 94 | } |