@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | protected function getSettings($section) { |
| 78 | 78 | $settings = $this->settingsManager->getAdminSettings($section); |
| 79 | 79 | $formatted = $this->formatSettings($settings); |
| 80 | - if($section === 'additional') { |
|
| 80 | + if ($section === 'additional') { |
|
| 81 | 81 | $formatted['content'] .= $this->getLegacyForms(); |
| 82 | 82 | } |
| 83 | 83 | return $formatted; |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | private function getLegacyForms() { |
| 90 | 90 | $forms = \OC_App::getForms('admin'); |
| 91 | 91 | |
| 92 | - $forms = array_map(function ($form) { |
|
| 92 | + $forms = array_map(function($form) { |
|
| 93 | 93 | if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
| 94 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
| 94 | + $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); |
|
| 95 | 95 | $sectionName = str_replace('</h2>', '', $sectionName); |
| 96 | 96 | $anchor = strtolower($sectionName); |
| 97 | 97 | $anchor = str_replace(' ', '-', $anchor); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $this->uid = $uid; |
| 85 | 85 | $this->backend = $backend; |
| 86 | 86 | $this->emitter = $emitter; |
| 87 | - if(is_null($config)) { |
|
| 87 | + if (is_null($config)) { |
|
| 88 | 88 | $config = \OC::$server->getConfig(); |
| 89 | 89 | } |
| 90 | 90 | $this->config = $config; |
@@ -160,12 +160,12 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function setEMailAddress($mailAddress) { |
| 162 | 162 | $oldMailAddress = $this->getEMailAddress(); |
| 163 | - if($mailAddress === '') { |
|
| 163 | + if ($mailAddress === '') { |
|
| 164 | 164 | $this->config->deleteUserValue($this->uid, 'settings', 'email'); |
| 165 | 165 | } else { |
| 166 | 166 | $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress); |
| 167 | 167 | } |
| 168 | - if($oldMailAddress !== $mailAddress) { |
|
| 168 | + if ($oldMailAddress !== $mailAddress) { |
|
| 169 | 169 | $this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress); |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | // Delete the users entry in the storage table |
| 232 | - Storage::remove('home::' . $this->uid); |
|
| 232 | + Storage::remove('home::'.$this->uid); |
|
| 233 | 233 | |
| 234 | 234 | \OC::$server->getCommentsManager()->deleteReferencesOfActor('users', $this->uid); |
| 235 | 235 | \OC::$server->getCommentsManager()->deleteReadMarksFromUser($this); |
@@ -281,9 +281,9 @@ discard block |
||
| 281 | 281 | if ($this->backend->implementsActions(Backend::GET_HOME) and $home = $this->backend->getHome($this->uid)) { |
| 282 | 282 | $this->home = $home; |
| 283 | 283 | } elseif ($this->config) { |
| 284 | - $this->home = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $this->uid; |
|
| 284 | + $this->home = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$this->uid; |
|
| 285 | 285 | } else { |
| 286 | - $this->home = \OC::$SERVERROOT . '/data/' . $this->uid; |
|
| 286 | + $this->home = \OC::$SERVERROOT.'/data/'.$this->uid; |
|
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | return $this->home; |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @return string |
| 296 | 296 | */ |
| 297 | 297 | public function getBackendClassName() { |
| 298 | - if($this->backend instanceof IUserBackend) { |
|
| 298 | + if ($this->backend instanceof IUserBackend) { |
|
| 299 | 299 | return $this->backend->getBackendName(); |
| 300 | 300 | } |
| 301 | 301 | return get_class($this->backend); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | */ |
| 377 | 377 | public function getQuota() { |
| 378 | 378 | $quota = $this->config->getUserValue($this->uid, 'files', 'quota', 'default'); |
| 379 | - if($quota === 'default') { |
|
| 379 | + if ($quota === 'default') { |
|
| 380 | 380 | $quota = $this->config->getAppValue('files', 'default_quota', 'none'); |
| 381 | 381 | } |
| 382 | 382 | return $quota; |
@@ -391,12 +391,12 @@ discard block |
||
| 391 | 391 | */ |
| 392 | 392 | public function setQuota($quota) { |
| 393 | 393 | $oldQuota = $this->config->getUserValue($this->uid, 'files', 'quota', ''); |
| 394 | - if($quota !== 'none' and $quota !== 'default') { |
|
| 394 | + if ($quota !== 'none' and $quota !== 'default') { |
|
| 395 | 395 | $quota = OC_Helper::computerFileSize($quota); |
| 396 | 396 | $quota = OC_Helper::humanFileSize($quota); |
| 397 | 397 | } |
| 398 | 398 | $this->config->setUserValue($this->uid, 'files', 'quota', $quota); |
| 399 | - if($quota !== $oldQuota) { |
|
| 399 | + if ($quota !== $oldQuota) { |
|
| 400 | 400 | $this->triggerChange('quota', $quota); |
| 401 | 401 | } |
| 402 | 402 | } |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | public function getCloudId() { |
| 433 | 433 | $uid = $this->getUID(); |
| 434 | 434 | $server = $this->urlGenerator->getAbsoluteURL('/'); |
| 435 | - $server = rtrim( $this->removeProtocolFromUrl($server), '/'); |
|
| 435 | + $server = rtrim($this->removeProtocolFromUrl($server), '/'); |
|
| 436 | 436 | return \OC::$server->getCloudIdManager()->getCloudId($uid, $server)->getId(); |
| 437 | 437 | } |
| 438 | 438 | |
@@ -29,13 +29,13 @@ |
||
| 29 | 29 | |
| 30 | 30 | OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; |
| 31 | 31 | |
| 32 | -require_once __DIR__ . '/../3rdparty/autoload.php'; |
|
| 32 | +require_once __DIR__.'/../3rdparty/autoload.php'; |
|
| 33 | 33 | |
| 34 | 34 | // register Application object singleton |
| 35 | 35 | \OC_Mount_Config::$app = new \OCA\Files_External\AppInfo\Application(); |
| 36 | 36 | $appContainer = \OC_Mount_Config::$app->getContainer(); |
| 37 | 37 | |
| 38 | -\OCA\Files\App::getNavigationManager()->add(function () { |
|
| 38 | +\OCA\Files\App::getNavigationManager()->add(function() { |
|
| 39 | 39 | $l = \OC::$server->getL10N('files_external'); |
| 40 | 40 | return [ |
| 41 | 41 | 'id' => 'extstoragemounts', |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | $olderVersions = $ms->getMigratedVersions(); |
| 79 | 79 | $olderVersions[] = '0'; |
| 80 | 80 | $olderVersions[] = 'prev'; |
| 81 | - if (in_array($version, $olderVersions, true)) { |
|
| 81 | + if (in_array($version, $olderVersions, true)) { |
|
| 82 | 82 | $output->writeln('<error>Can not go back to previous migration without debug enabled</error>'); |
| 83 | 83 | return 1; |
| 84 | 84 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | private function quoteKeys(array $data) { |
| 33 | 33 | $return = []; |
| 34 | 34 | $c = $this->getDatabasePlatform()->getIdentifierQuoteCharacter(); |
| 35 | - foreach($data as $key => $value) { |
|
| 35 | + foreach ($data as $key => $value) { |
|
| 36 | 36 | if ($key[0] !== $c) { |
| 37 | 37 | $return[$this->quoteIdentifier($key)] = $value; |
| 38 | 38 | } else { |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | * @param string $table table name without the prefix |
| 83 | 83 | */ |
| 84 | 84 | public function dropTable($table) { |
| 85 | - $table = $this->tablePrefix . trim($table); |
|
| 85 | + $table = $this->tablePrefix.trim($table); |
|
| 86 | 86 | $table = $this->quoteIdentifier($table); |
| 87 | 87 | $schema = $this->getSchemaManager(); |
| 88 | - if($schema->tablesExist(array($table))) { |
|
| 88 | + if ($schema->tablesExist(array($table))) { |
|
| 89 | 89 | $schema->dropTable($table); |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | * @param string $table table name without the prefix |
| 97 | 97 | * @return bool |
| 98 | 98 | */ |
| 99 | - public function tableExists($table){ |
|
| 100 | - $table = $this->tablePrefix . trim($table); |
|
| 99 | + public function tableExists($table) { |
|
| 100 | + $table = $this->tablePrefix.trim($table); |
|
| 101 | 101 | $table = $this->quoteIdentifier($table); |
| 102 | 102 | $schema = $this->getSchemaManager(); |
| 103 | 103 | return $schema->tablesExist(array($table)); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @throws \Doctrine\DBAL\Schema\SchemaException |
| 81 | 81 | */ |
| 82 | 82 | public function getTable($tableName) { |
| 83 | - return $this->schema->getTable($this->connection->getPrefix() . $tableName); |
|
| 83 | + return $this->schema->getTable($this->connection->getPrefix().$tableName); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @return boolean |
| 92 | 92 | */ |
| 93 | 93 | public function hasTable($tableName) { |
| 94 | - return $this->schema->hasTable($this->connection->getPrefix() . $tableName); |
|
| 94 | + return $this->schema->hasTable($this->connection->getPrefix().$tableName); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @return \Doctrine\DBAL\Schema\Table |
| 102 | 102 | */ |
| 103 | 103 | public function createTable($tableName) { |
| 104 | - return $this->schema->createTable($this->connection->getPrefix() . $tableName); |
|
| 104 | + return $this->schema->createTable($this->connection->getPrefix().$tableName); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function dropTable($tableName) { |
| 127 | 127 | $this->tablesToDelete[$tableName] = true; |
| 128 | - return $this->schema->dropTable($this->connection->getPrefix() . $tableName); |
|
| 128 | + return $this->schema->dropTable($this->connection->getPrefix().$tableName); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | public function getACL() { |
| 113 | - $acl = [ |
|
| 113 | + $acl = [ |
|
| 114 | 114 | [ |
| 115 | 115 | 'privilege' => '{DAV:}read', |
| 116 | 116 | 'principal' => $this->getOwner(), |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if ($this->getOwner() !== parent::getOwner()) { |
| 134 | - $acl[] = [ |
|
| 134 | + $acl[] = [ |
|
| 135 | 135 | 'privilege' => '{DAV:}read', |
| 136 | 136 | 'principal' => parent::getOwner(), |
| 137 | 137 | 'protected' => true, |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | public function delete() { |
| 179 | 179 | if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) && |
| 180 | 180 | $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) { |
| 181 | - $principal = 'principal:' . parent::getOwner(); |
|
| 181 | + $principal = 'principal:'.parent::getOwner(); |
|
| 182 | 182 | $shares = $this->caldavBackend->getShares($this->getResourceId()); |
| 183 | 183 | $shares = array_filter($shares, function($share) use ($principal){ |
| 184 | 184 | return $share['href'] === $principal; |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | $uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters); |
| 269 | 269 | if ($this->isShared()) { |
| 270 | - return array_filter($uris, function ($uri) { |
|
| 270 | + return array_filter($uris, function($uri) { |
|
| 271 | 271 | return $this->childExists($uri); |
| 272 | 272 | }); |
| 273 | 273 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->config = $config; |
| 97 | 97 | |
| 98 | 98 | $this->excludedPaths[] = 'files_encryption'; |
| 99 | - $this->excludedPaths[] = 'appdata_' . $config->getSystemValue('instanceid', null); |
|
| 99 | + $this->excludedPaths[] = 'appdata_'.$config->getSystemValue('instanceid', null); |
|
| 100 | 100 | $this->excludedPaths[] = 'files_external'; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | * @throws EncryptionHeaderKeyExistsException if header key is already in use |
| 137 | 137 | */ |
| 138 | 138 | public function createHeader(array $headerData, IEncryptionModule $encryptionModule) { |
| 139 | - $header = self::HEADER_START . ':' . self::HEADER_ENCRYPTION_MODULE_KEY . ':' . $encryptionModule->getId() . ':'; |
|
| 139 | + $header = self::HEADER_START.':'.self::HEADER_ENCRYPTION_MODULE_KEY.':'.$encryptionModule->getId().':'; |
|
| 140 | 140 | foreach ($headerData as $key => $value) { |
| 141 | 141 | if (in_array($key, $this->ocHeaderKeys)) { |
| 142 | 142 | throw new EncryptionHeaderKeyExistsException($key); |
| 143 | 143 | } |
| 144 | - $header .= $key . ':' . $value . ':'; |
|
| 144 | + $header .= $key.':'.$value.':'; |
|
| 145 | 145 | } |
| 146 | 146 | $header .= self::HEADER_END; |
| 147 | 147 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | if ($c->getType() === 'dir') { |
| 173 | 173 | $dirList[] = $c->getPath(); |
| 174 | 174 | } else { |
| 175 | - $result[] = $c->getPath(); |
|
| 175 | + $result[] = $c->getPath(); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
@@ -249,15 +249,15 @@ discard block |
||
| 249 | 249 | public function stripPartialFileExtension($path) { |
| 250 | 250 | $extension = pathinfo($path, PATHINFO_EXTENSION); |
| 251 | 251 | |
| 252 | - if ( $extension === 'part') { |
|
| 252 | + if ($extension === 'part') { |
|
| 253 | 253 | |
| 254 | 254 | $newLength = strlen($path) - 5; // 5 = strlen(".part") |
| 255 | 255 | $fPath = substr($path, 0, $newLength); |
| 256 | 256 | |
| 257 | 257 | // if path also contains a transaction id, we remove it too |
| 258 | 258 | $extension = pathinfo($fPath, PATHINFO_EXTENSION); |
| 259 | - if(substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") |
|
| 260 | - $newLength = strlen($fPath) - strlen($extension) -1; |
|
| 259 | + if (substr($extension, 0, 12) === 'ocTransferId') { // 12 = strlen("ocTransferId") |
|
| 260 | + $newLength = strlen($fPath) - strlen($extension) - 1; |
|
| 261 | 261 | $fPath = substr($fPath, 0, $newLength); |
| 262 | 262 | } |
| 263 | 263 | return $fPath; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | if (\OCP\App::isEnabled("files_external")) { |
| 302 | 302 | $mounts = \OC_Mount_Config::getSystemMountPoints(); |
| 303 | 303 | foreach ($mounts as $mount) { |
| 304 | - if (strpos($path, '/files/' . $mount['mountpoint']) === 0) { |
|
| 304 | + if (strpos($path, '/files/'.$mount['mountpoint']) === 0) { |
|
| 305 | 305 | if ($this->isMountPointApplicableToUser($mount, $uid)) { |
| 306 | 306 | return true; |
| 307 | 307 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <div class="error"> |
| 2 | 2 | <h2><?php p($l->t('Error')) ?></h2> |
| 3 | 3 | <ul> |
| 4 | - <?php foreach($_["errors"] as $error):?> |
|
| 4 | + <?php foreach ($_["errors"] as $error):?> |
|
| 5 | 5 | <li> |
| 6 | 6 | <p><?php p($error['error']) ?></p> |
| 7 | - <?php if(isset($error['hint']) && $error['hint']): ?> |
|
| 7 | + <?php if (isset($error['hint']) && $error['hint']): ?> |
|
| 8 | 8 | <p class='hint'><?php p($error['hint']) ?></p> |
| 9 | - <?php endif;?> |
|
| 9 | + <?php endif; ?> |
|
| 10 | 10 | </li> |
| 11 | 11 | <?php endforeach ?> |
| 12 | 12 | </ul> |