@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $this->input = $input; |
| 134 | 134 | $this->output = $output; |
| 135 | 135 | |
| 136 | - $headline = 'Encrypt all files with the ' . Encryption::DISPLAY_NAME; |
|
| 136 | + $headline = 'Encrypt all files with the '.Encryption::DISPLAY_NAME; |
|
| 137 | 137 | $this->output->writeln("\n"); |
| 138 | 138 | $this->output->writeln($headline); |
| 139 | 139 | $this->output->writeln(str_pad('', strlen($headline), '=')); |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | $progress->setFormat(" %message% \n [%bar%]"); |
| 180 | 180 | $progress->start(); |
| 181 | 181 | |
| 182 | - foreach($this->userManager->getBackends() as $backend) { |
|
| 182 | + foreach ($this->userManager->getBackends() as $backend) { |
|
| 183 | 183 | $limit = 500; |
| 184 | 184 | $offset = 0; |
| 185 | 185 | do { |
| 186 | 186 | $users = $backend->getUsers('', $limit, $offset); |
| 187 | 187 | foreach ($users as $user) { |
| 188 | 188 | if ($this->keyManager->userHasKeys($user) === false) { |
| 189 | - $progress->setMessage('Create key-pair for ' . $user); |
|
| 189 | + $progress->setMessage('Create key-pair for '.$user); |
|
| 190 | 190 | $progress->advance(); |
| 191 | 191 | $this->setupUserFS($user); |
| 192 | 192 | $password = $this->generateOneTimePassword($user); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | $offset += $limit; |
| 201 | - } while(count($users) >= $limit); |
|
| 201 | + } while (count($users) >= $limit); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | $progress->setMessage('Key-pair created for all users'); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | protected function encryptAllUserFilesWithMasterKey(ProgressBar $progress) { |
| 238 | 238 | $userNo = 1; |
| 239 | - foreach($this->userManager->getBackends() as $backend) { |
|
| 239 | + foreach ($this->userManager->getBackends() as $backend) { |
|
| 240 | 240 | $limit = 500; |
| 241 | 241 | $offset = 0; |
| 242 | 242 | do { |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $userNo++; |
| 248 | 248 | } |
| 249 | 249 | $offset += $limit; |
| 250 | - } while(count($users) >= $limit); |
|
| 250 | + } while (count($users) >= $limit); |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
@@ -262,19 +262,19 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | $this->setupUserFS($uid); |
| 264 | 264 | $directories = array(); |
| 265 | - $directories[] = '/' . $uid . '/files'; |
|
| 265 | + $directories[] = '/'.$uid.'/files'; |
|
| 266 | 266 | |
| 267 | - while($root = array_pop($directories)) { |
|
| 267 | + while ($root = array_pop($directories)) { |
|
| 268 | 268 | $content = $this->rootView->getDirectoryContent($root); |
| 269 | 269 | foreach ($content as $file) { |
| 270 | - $path = $root . '/' . $file['name']; |
|
| 270 | + $path = $root.'/'.$file['name']; |
|
| 271 | 271 | if ($this->rootView->is_dir($path)) { |
| 272 | 272 | $directories[] = $path; |
| 273 | 273 | continue; |
| 274 | 274 | } else { |
| 275 | 275 | $progress->setMessage("encrypt files for user $userCount: $path"); |
| 276 | 276 | $progress->advance(); |
| 277 | - if($this->encryptFile($path) === false) { |
|
| 277 | + if ($this->encryptFile($path) === false) { |
|
| 278 | 278 | $progress->setMessage("encrypt files for user $userCount: $path (already encrypted)"); |
| 279 | 279 | $progress->advance(); |
| 280 | 280 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | protected function encryptFile($path) { |
| 293 | 293 | |
| 294 | 294 | $source = $path; |
| 295 | - $target = $path . '.encrypted.' . time(); |
|
| 295 | + $target = $path.'.encrypted.'.time(); |
|
| 296 | 296 | |
| 297 | 297 | try { |
| 298 | 298 | $this->rootView->copy($source, $target); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | continue; |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | - $subject = (string)$this->l->t('one-time password for server-side-encryption'); |
|
| 417 | + $subject = (string) $this->l->t('one-time password for server-side-encryption'); |
|
| 418 | 418 | list($htmlBody, $textBody) = $this->createMailBody($password); |
| 419 | 419 | |
| 420 | 420 | // send it out now |
@@ -462,11 +462,11 @@ discard block |
||
| 462 | 462 | protected function createMailBody($password) { |
| 463 | 463 | |
| 464 | 464 | $html = new \OC_Template("encryption", "mail", ""); |
| 465 | - $html->assign ('password', $password); |
|
| 465 | + $html->assign('password', $password); |
|
| 466 | 466 | $htmlMail = $html->fetchPage(); |
| 467 | 467 | |
| 468 | 468 | $plainText = new \OC_Template("encryption", "altmail", ""); |
| 469 | - $plainText->assign ('password', $password); |
|
| 469 | + $plainText->assign('password', $password); |
|
| 470 | 470 | $plainTextMail = $plainText->fetchPage(); |
| 471 | 471 | |
| 472 | 472 | return [$htmlMail, $plainTextMail]; |
@@ -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; |
@@ -181,12 +181,12 @@ |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | $message = preg_replace( |
| 184 | - '/(^|\s)(' . '@' . $mention['id'] . ')(\b)/', |
|
| 184 | + '/(^|\s)('.'@'.$mention['id'].')(\b)/', |
|
| 185 | 185 | //'${1}' . $this->regexSafeUser($mention['id'], $displayName) . '${3}', |
| 186 | - '${1}' . '{mention' . $mentionCount . '}' . '${3}', |
|
| 186 | + '${1}'.'{mention'.$mentionCount.'}'.'${3}', |
|
| 187 | 187 | $message |
| 188 | 188 | ); |
| 189 | - $mentions['mention' . $mentionCount] = $this->generateUserParameter($mention['id']); |
|
| 189 | + $mentions['mention'.$mentionCount] = $this->generateUserParameter($mention['id']); |
|
| 190 | 190 | $mentionCount++; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | $comment = $event->getComment(); |
| 56 | 56 | |
| 57 | 57 | $mentions = $this->extractMentions($comment->getMentions()); |
| 58 | - if(empty($mentions)) { |
|
| 58 | + if (empty($mentions)) { |
|
| 59 | 59 | // no one to notify |
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $notification = $this->instantiateNotification($comment); |
| 64 | 64 | |
| 65 | - foreach($mentions as $uid) { |
|
| 66 | - if( ($comment->getActorType() === 'users' && $uid === $comment->getActorId()) |
|
| 65 | + foreach ($mentions as $uid) { |
|
| 66 | + if (($comment->getActorType() === 'users' && $uid === $comment->getActorId()) |
|
| 67 | 67 | || !$this->userManager->userExists($uid) |
| 68 | 68 | ) { |
| 69 | 69 | // do not notify unknown users or yourself |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $notification->setUser($uid); |
| 74 | - if( $event->getEvent() === CommentsEvent::EVENT_DELETE |
|
| 74 | + if ($event->getEvent() === CommentsEvent::EVENT_DELETE |
|
| 75 | 75 | || $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE) |
| 76 | 76 | { |
| 77 | 77 | $this->notificationManager->markProcessed($notification); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $notification |
| 93 | 93 | ->setApp('comments') |
| 94 | 94 | ->setObject('comment', $comment->getId()) |
| 95 | - ->setSubject('mention', [ $comment->getObjectType(), $comment->getObjectId() ]) |
|
| 95 | + ->setSubject('mention', [$comment->getObjectType(), $comment->getObjectId()]) |
|
| 96 | 96 | ->setDateTime($comment->getCreationDateTime()); |
| 97 | 97 | |
| 98 | 98 | return $notification; |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | * @return string[] containing the mentions, e.g. ['alice', 'bob'] |
| 106 | 106 | */ |
| 107 | 107 | public function extractMentions(array $mentions) { |
| 108 | - if(empty($mentions)) { |
|
| 108 | + if (empty($mentions)) { |
|
| 109 | 109 | return []; |
| 110 | 110 | } |
| 111 | 111 | $uids = []; |
| 112 | - foreach($mentions as $mention) { |
|
| 113 | - if($mention['type'] === 'user') { |
|
| 112 | + foreach ($mentions as $mention) { |
|
| 113 | + if ($mention['type'] === 'user') { |
|
| 114 | 114 | $uids[] = $mention['id']; |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | * @param CommentsEvent $event |
| 52 | 52 | */ |
| 53 | 53 | public function handle(CommentsEvent $event) { |
| 54 | - if($event->getComment()->getObjectType() !== 'files') { |
|
| 54 | + if ($event->getComment()->getObjectType() !== 'files') { |
|
| 55 | 55 | // this is a 'files'-specific Handler |
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $eventType = $event->getEvent(); |
| 60 | - if( $eventType === CommentsEvent::EVENT_ADD |
|
| 60 | + if ($eventType === CommentsEvent::EVENT_ADD |
|
| 61 | 61 | ) { |
| 62 | 62 | $this->notificationHandler($event); |
| 63 | 63 | $this->activityHandler($event); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | CommentsEvent::EVENT_UPDATE, |
| 70 | 70 | CommentsEvent::EVENT_DELETE, |
| 71 | 71 | ]; |
| 72 | - if(in_array($eventType, $applicableEvents)) { |
|
| 72 | + if (in_array($eventType, $applicableEvents)) { |
|
| 73 | 73 | $this->notificationHandler($event); |
| 74 | 74 | return; |
| 75 | 75 | } |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | \OC::$server->getSession()->close(); |
| 26 | 26 | |
| 27 | 27 | // Load the files |
| 28 | -$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; |
|
| 29 | -$sortAttribute = isset($_GET['sort']) ? (string)$_GET['sort'] : 'name'; |
|
| 28 | +$dir = isset($_GET['dir']) ? (string) $_GET['dir'] : ''; |
|
| 29 | +$sortAttribute = isset($_GET['sort']) ? (string) $_GET['sort'] : 'name'; |
|
| 30 | 30 | $sortDirection = isset($_GET['sortdirection']) ? ($_GET['sortdirection'] === 'desc') : false; |
| 31 | 31 | $data = array(); |
| 32 | 32 | |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | \OC_Util::setupFS($user); |
| 118 | 118 | |
| 119 | 119 | // Check if this user has a trashbin directory |
| 120 | - $view = new \OC\Files\View('/' . $user); |
|
| 120 | + $view = new \OC\Files\View('/'.$user); |
|
| 121 | 121 | if (!$view->is_dir('/files_trashbin/files')) { |
| 122 | 122 | return false; |
| 123 | 123 | } |
@@ -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'))) |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | * @param string $value |
| 60 | 60 | * @return bool |
| 61 | 61 | */ |
| 62 | - public function executeCheck($operator, $value) { |
|
| 62 | + public function executeCheck($operator, $value) { |
|
| 63 | 63 | $actualValue = $this->getActualValue(); |
| 64 | 64 | return $this->executeStringCheck($operator, $value, $actualValue); |
| 65 | 65 | } |