@@ -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> |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | public function getForm() { |
| 66 | 66 | $cloudID = $this->userSession->getUser()->getCloudId(); |
| 67 | - $url = 'https://nextcloud.com/federation#' . $cloudID; |
|
| 67 | + $url = 'https://nextcloud.com/federation#'.$cloudID; |
|
| 68 | 68 | |
| 69 | 69 | $parameters = [ |
| 70 | 70 | 'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(), |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'edition' => '', |
| 96 | 96 | ); |
| 97 | 97 | |
| 98 | - if($this->userSession->isLoggedIn()) { |
|
| 98 | + if ($this->userSession->isLoggedIn()) { |
|
| 99 | 99 | $result['capabilities'] = $this->capabilitiesManager->getCapabilities(); |
| 100 | 100 | } else { |
| 101 | 101 | $result['capabilities'] = $this->capabilitiesManager->getCapabilities(true); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | public function getIdentityProof($cloudId) { |
| 139 | 139 | $userObject = $this->userManager->get($cloudId); |
| 140 | 140 | |
| 141 | - if($userObject !== null) { |
|
| 141 | + if ($userObject !== null) { |
|
| 142 | 142 | $key = $this->keyManager->getKey($userObject); |
| 143 | 143 | $data = [ |
| 144 | 144 | 'public' => $key->getPublic(), |
@@ -7,49 +7,49 @@ discard block |
||
| 7 | 7 | <form id="ocDefaultEncryptionModule" class="section"> |
| 8 | 8 | <h2 data-anchor-name="basic-encryption-module"><?php p($l->t('Basic encryption module')); ?></h2> |
| 9 | 9 | |
| 10 | - <?php if ($_["initialized"] === \OCA\Encryption\Session::NOT_INITIALIZED ): ?> |
|
| 10 | + <?php if ($_["initialized"] === \OCA\Encryption\Session::NOT_INITIALIZED): ?> |
|
| 11 | 11 | |
| 12 | 12 | <?php p($l->t("Encryption App is enabled, but your keys are not initialized. Please log-out and log-in again.")); ?> |
| 13 | 13 | |
| 14 | - <?php elseif ( $_["initialized"] === \OCA\Encryption\Session::INIT_EXECUTED ): ?> |
|
| 14 | + <?php elseif ($_["initialized"] === \OCA\Encryption\Session::INIT_EXECUTED): ?> |
|
| 15 | 15 | <p> |
| 16 | 16 | <a name="changePKPasswd" /> |
| 17 | 17 | <label for="changePrivateKeyPasswd"> |
| 18 | - <em><?php p( $l->t( "Your private key password no longer matches your log-in password." ) ); ?></em> |
|
| 18 | + <em><?php p($l->t("Your private key password no longer matches your log-in password.")); ?></em> |
|
| 19 | 19 | </label> |
| 20 | 20 | <br /> |
| 21 | - <?php p( $l->t( "Set your old private key password to your current log-in password:" ) ); ?> |
|
| 22 | - <?php if ( $_["recoveryEnabledForUser"] ): |
|
| 23 | - p( $l->t( " If you don't remember your old password you can ask your administrator to recover your files." ) ); |
|
| 21 | + <?php p($l->t("Set your old private key password to your current log-in password:")); ?> |
|
| 22 | + <?php if ($_["recoveryEnabledForUser"]): |
|
| 23 | + p($l->t(" If you don't remember your old password you can ask your administrator to recover your files.")); |
|
| 24 | 24 | endif; ?> |
| 25 | 25 | <br /> |
| 26 | 26 | <input |
| 27 | 27 | type="password" |
| 28 | 28 | name="changePrivateKeyPassword" |
| 29 | 29 | id="oldPrivateKeyPassword" /> |
| 30 | - <label for="oldPrivateKeyPassword"><?php p($l->t( "Old log-in password" )); ?></label> |
|
| 30 | + <label for="oldPrivateKeyPassword"><?php p($l->t("Old log-in password")); ?></label> |
|
| 31 | 31 | <br /> |
| 32 | 32 | <input |
| 33 | 33 | type="password" |
| 34 | 34 | name="changePrivateKeyPassword" |
| 35 | 35 | id="newPrivateKeyPassword" /> |
| 36 | - <label for="newRecoveryPassword"><?php p($l->t( "Current log-in password" )); ?></label> |
|
| 36 | + <label for="newRecoveryPassword"><?php p($l->t("Current log-in password")); ?></label> |
|
| 37 | 37 | <br /> |
| 38 | 38 | <button |
| 39 | 39 | type="button" |
| 40 | 40 | name="submitChangePrivateKeyPassword" |
| 41 | - disabled><?php p($l->t( "Update Private Key Password" )); ?> |
|
| 41 | + disabled><?php p($l->t("Update Private Key Password")); ?> |
|
| 42 | 42 | </button> |
| 43 | 43 | <span class="msg"></span> |
| 44 | 44 | </p> |
| 45 | 45 | |
| 46 | - <?php elseif ( $_["recoveryEnabled"] && $_["privateKeySet"] && $_["initialized"] === \OCA\Encryption\Session::INIT_SUCCESSFUL ): ?> |
|
| 46 | + <?php elseif ($_["recoveryEnabled"] && $_["privateKeySet"] && $_["initialized"] === \OCA\Encryption\Session::INIT_SUCCESSFUL): ?> |
|
| 47 | 47 | <br /> |
| 48 | 48 | <p id="userEnableRecovery"> |
| 49 | - <label for="userEnableRecovery"><?php p( $l->t( "Enable password recovery:" ) ); ?></label> |
|
| 49 | + <label for="userEnableRecovery"><?php p($l->t("Enable password recovery:")); ?></label> |
|
| 50 | 50 | <span class="msg"></span> |
| 51 | 51 | <br /> |
| 52 | - <em><?php p( $l->t( "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" ) ); ?></em> |
|
| 52 | + <em><?php p($l->t("Enabling this option will allow you to reobtain access to your encrypted files in case of password loss")); ?></em> |
|
| 53 | 53 | <br /> |
| 54 | 54 | <input |
| 55 | 55 | type="radio" |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | id="userEnableRecoveryCheckbox" |
| 58 | 58 | name="userEnableRecovery" |
| 59 | 59 | value="1" |
| 60 | - <?php echo ( $_["recoveryEnabledForUser"] ? 'checked="checked"' : '' ); ?> /> |
|
| 61 | - <label for="userEnableRecoveryCheckbox"><?php p( $l->t( "Enabled" ) ); ?></label> |
|
| 60 | + <?php echo ($_["recoveryEnabledForUser"] ? 'checked="checked"' : ''); ?> /> |
|
| 61 | + <label for="userEnableRecoveryCheckbox"><?php p($l->t("Enabled")); ?></label> |
|
| 62 | 62 | <br /> |
| 63 | 63 | |
| 64 | 64 | <input |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | id="userDisableRecoveryCheckbox" |
| 68 | 68 | name="userEnableRecovery" |
| 69 | 69 | value="0" |
| 70 | - <?php echo ( $_["recoveryEnabledForUser"] === false ? 'checked="checked"' : '' ); ?> /> |
|
| 71 | - <label for="userDisableRecoveryCheckbox"><?php p( $l->t( "Disabled" ) ); ?></label> |
|
| 70 | + <?php echo ($_["recoveryEnabledForUser"] === false ? 'checked="checked"' : ''); ?> /> |
|
| 71 | + <label for="userDisableRecoveryCheckbox"><?php p($l->t("Disabled")); ?></label> |
|
| 72 | 72 | </p> |
| 73 | 73 | <?php endif; ?> |
| 74 | 74 | </form> |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | $appName = $input->getArgument('app'); |
| 61 | 61 | $version = $input->getArgument('version'); |
| 62 | 62 | |
| 63 | - if (!preg_match('/^\d{1,16}$/',$version)) { |
|
| 63 | + if (!preg_match('/^\d{1,16}$/', $version)) { |
|
| 64 | 64 | $output->writeln('<error>The given version is invalid. Only 0-9 are allowed (max. 16 digits)</error>'); |
| 65 | 65 | return 1; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $schemaFile = $this->appManager->getAppPath($appName) . '/appinfo/database.xml'; |
|
| 68 | + $schemaFile = $this->appManager->getAppPath($appName).'/appinfo/database.xml'; |
|
| 69 | 69 | if (!file_exists($schemaFile)) { |
| 70 | - $output->writeln('<error>App ' . $appName . ' does not have a database.xml file</error>'); |
|
| 70 | + $output->writeln('<error>App '.$appName.' does not have a database.xml file</error>'); |
|
| 71 | 71 | return 2; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output)); |
| 81 | 81 | |
| 82 | 82 | $date = date('YmdHis'); |
| 83 | - $path = $this->generateMigration($ms, 'Version' . $version . 'Date' . $date, $schemaBody); |
|
| 83 | + $path = $this->generateMigration($ms, 'Version'.$version.'Date'.$date, $schemaBody); |
|
| 84 | 84 | |
| 85 | 85 | $output->writeln("New migration class has been generated to <info>$path</info>"); |
| 86 | 86 | return 0; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // default responders |
| 79 | 79 | $this->responders = array( |
| 80 | - 'json' => function ($data) { |
|
| 80 | + 'json' => function($data) { |
|
| 81 | 81 | if ($data instanceof DataResponse) { |
| 82 | 82 | $response = new JSONResponse( |
| 83 | 83 | $data->getData(), |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @since 7.0.0 |
| 107 | 107 | * @since 9.1.0 Added default parameter |
| 108 | 108 | */ |
| 109 | - public function getResponderByHTTPHeader($acceptHeader, $default='json') { |
|
| 109 | + public function getResponderByHTTPHeader($acceptHeader, $default = 'json') { |
|
| 110 | 110 | $headers = explode(',', $acceptHeader); |
| 111 | 111 | |
| 112 | 112 | // return the first matching responder |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | * @return Response |
| 146 | 146 | * @since 7.0.0 |
| 147 | 147 | */ |
| 148 | - public function buildResponse($response, $format='json') { |
|
| 149 | - if(array_key_exists($format, $this->responders)) { |
|
| 148 | + public function buildResponse($response, $format = 'json') { |
|
| 149 | + if (array_key_exists($format, $this->responders)) { |
|
| 150 | 150 | |
| 151 | 151 | $responder = $this->responders[$format]; |
| 152 | 152 | |
@@ -154,6 +154,6 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | } |
| 156 | 156 | throw new \DomainException('No responder registered for format '. |
| 157 | - $format . '!'); |
|
| 157 | + $format.'!'); |
|
| 158 | 158 | } |
| 159 | 159 | } |