@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | $isAlreadyEnabled = $this->util->isMasterKeyEnabled(); |
| 70 | 70 | |
| 71 | - if($isAlreadyEnabled) { |
|
| 71 | + if ($isAlreadyEnabled) { |
|
| 72 | 72 | $output->writeln('Master key already enabled'); |
| 73 | 73 | } else { |
| 74 | 74 | $question = new ConfirmationQuestion( |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $this->isWriteOperation = false; |
| 178 | 178 | $this->writeCache = ''; |
| 179 | 179 | |
| 180 | - if($this->session->isReady() === false) { |
|
| 180 | + if ($this->session->isReady() === false) { |
|
| 181 | 181 | // if the master key is enabled we can initialize encryption |
| 182 | 182 | // with a empty password and user name |
| 183 | 183 | if ($this->util->isMasterKeyEnabled()) { |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | // always use the version from the original file, also part files |
| 199 | 199 | // need to have a correct version number if they get moved over to the |
| 200 | 200 | // final location |
| 201 | - $this->version = (int)$this->keyManager->getVersion($this->stripPartFileExtension($path), new View()); |
|
| 201 | + $this->version = (int) $this->keyManager->getVersion($this->stripPartFileExtension($path), new View()); |
|
| 202 | 202 | |
| 203 | 203 | if ( |
| 204 | 204 | $mode === 'w' |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | // if we read a part file we need to increase the version by 1 |
| 215 | 215 | // because the version number was also increased by writing |
| 216 | 216 | // the part file |
| 217 | - if(Scanner::isPartialFile($path)) { |
|
| 217 | + if (Scanner::isPartialFile($path)) { |
|
| 218 | 218 | $this->version = $this->version + 1; |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | if ($this->writeCache) { |
| 301 | 301 | |
| 302 | 302 | // Concat writeCache to start of $data |
| 303 | - $data = $this->writeCache . $data; |
|
| 303 | + $data = $this->writeCache.$data; |
|
| 304 | 304 | |
| 305 | 305 | // Clear the write cache, ready for reuse - it has been |
| 306 | 306 | // flushed and its old contents processed |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | try { |
| 403 | 403 | $publicKeys[$user] = $this->keyManager->getPublicKey($user); |
| 404 | 404 | } catch (PublicKeyMissingException $e) { |
| 405 | - $this->logger->warning('Could not encrypt file for ' . $user . ': ' . $e->getMessage()); |
|
| 405 | + $this->logger->warning('Could not encrypt file for '.$user.': '.$e->getMessage()); |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | } |
@@ -489,8 +489,8 @@ discard block |
||
| 489 | 489 | // error message because in this case it means that the file was |
| 490 | 490 | // shared with the user at a point where the user didn't had a |
| 491 | 491 | // valid private/public key |
| 492 | - $msg = 'Encryption module "' . $this->getDisplayName() . |
|
| 493 | - '" is not able to read ' . $path; |
|
| 492 | + $msg = 'Encryption module "'.$this->getDisplayName(). |
|
| 493 | + '" is not able to read '.$path; |
|
| 494 | 494 | $hint = $this->l->t('Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you.'); |
| 495 | 495 | $this->logger->warning($msg); |
| 496 | 496 | throw new DecryptionFailedException($msg, $hint); |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | $realPath = $path; |
| 533 | 533 | $parts = explode('/', $path); |
| 534 | 534 | if ($parts[2] === 'files_versions') { |
| 535 | - $realPath = '/' . $parts[1] . '/files/' . implode('/', array_slice($parts, 3)); |
|
| 535 | + $realPath = '/'.$parts[1].'/files/'.implode('/', array_slice($parts, 3)); |
|
| 536 | 536 | $length = strrpos($realPath, '.'); |
| 537 | 537 | $realPath = substr($realPath, 0, $length); |
| 538 | 538 | } |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $question = new Question('Please enter the recovery key password: '); |
| 85 | 85 | |
| 86 | - if($this->util->isMasterKeyEnabled()) { |
|
| 86 | + if ($this->util->isMasterKeyEnabled()) { |
|
| 87 | 87 | $output->writeln('Use master key to decrypt all files'); |
| 88 | 88 | $user = $this->keyManager->getMasterKeyId(); |
| 89 | - $password =$this->keyManager->getMasterKeyPassword(); |
|
| 89 | + $password = $this->keyManager->getMasterKeyPassword(); |
|
| 90 | 90 | } else { |
| 91 | 91 | $recoveryKeyId = $this->keyManager->getRecoveryKeyId(); |
| 92 | 92 | if (!empty($user)) { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | if ($useLoginPassword) { |
| 102 | 102 | $question = new Question('Please enter the user\'s login password: '); |
| 103 | 103 | } else if ($this->util->isRecoveryEnabledForUser($user) === false) { |
| 104 | - $output->writeln('No recovery key available for user ' . $user); |
|
| 104 | + $output->writeln('No recovery key available for user '.$user); |
|
| 105 | 105 | return false; |
| 106 | 106 | } else { |
| 107 | 107 | $user = $recoveryKeyId; |
@@ -107,8 +107,8 @@ |
||
| 107 | 107 | protected function removeDeletedFiles($uid) { |
| 108 | 108 | \OC_Util::tearDownFS(); |
| 109 | 109 | \OC_Util::setupFS($uid); |
| 110 | - if ($this->rootFolder->nodeExists('/' . $uid . '/files_trashbin')) { |
|
| 111 | - $this->rootFolder->get('/' . $uid . '/files_trashbin')->delete(); |
|
| 110 | + if ($this->rootFolder->nodeExists('/'.$uid.'/files_trashbin')) { |
|
| 111 | + $this->rootFolder->get('/'.$uid.'/files_trashbin')->delete(); |
|
| 112 | 112 | $query = $this->dbConnection->getQueryBuilder(); |
| 113 | 113 | $query->delete('files_trash') |
| 114 | 114 | ->where($query->expr()->eq('user', $query->createParameter('uid'))) |
@@ -109,8 +109,8 @@ |
||
| 109 | 109 | throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - $regexValue = '\"' . self::REGEX_TIME . ' ' . self::REGEX_TIMEZONE . '\"'; |
|
| 113 | - $result = preg_match('/^\[' . $regexValue . ',' . $regexValue . '\]$/', $value, $matches); |
|
| 112 | + $regexValue = '\"'.self::REGEX_TIME.' '.self::REGEX_TIMEZONE.'\"'; |
|
| 113 | + $result = preg_match('/^\['.$regexValue.','.$regexValue.'\]$/', $value, $matches); |
|
| 114 | 114 | if (!$result) { |
| 115 | 115 | throw new \UnexpectedValueException($this->l->t('The given time span is invalid'), 2); |
| 116 | 116 | } |
@@ -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; |
@@ -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 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $token = $argument['token']; |
| 106 | 106 | $action = $argument['action']; |
| 107 | 107 | $data = json_decode($argument['data'], true); |
| 108 | - $try = (int)$argument['try'] + 1; |
|
| 108 | + $try = (int) $argument['try'] + 1; |
|
| 109 | 109 | |
| 110 | 110 | $result = $this->notifications->sendUpdateToRemote($remote, $remoteId, $token, $action, $data, $try); |
| 111 | 111 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | 'token' => $argument['token'], |
| 129 | 129 | 'data' => $argument['data'], |
| 130 | 130 | 'action' => $argument['action'], |
| 131 | - 'try' => (int)$argument['try'] + 1, |
|
| 131 | + 'try' => (int) $argument['try'] + 1, |
|
| 132 | 132 | 'lastRun' => time() |
| 133 | 133 | ] |
| 134 | 134 | ); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @return bool |
| 142 | 142 | */ |
| 143 | 143 | protected function shouldRun(array $argument) { |
| 144 | - $lastRun = (int)$argument['lastRun']; |
|
| 144 | + $lastRun = (int) $argument['lastRun']; |
|
| 145 | 145 | return ((time() - $lastRun) > $this->interval); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | public function generateToken() { |
| 56 | 56 | $token = $this->secureRandom->generate( |
| 57 | 57 | self::TOKEN_LENGTH, |
| 58 | - ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
| 58 | + ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
| 59 | 59 | return $token; |
| 60 | 60 | } |
| 61 | 61 | |