@@ -99,7 +99,7 @@ |
||
| 99 | 99 | $currentChannel = \OCP\Util::getChannel(); |
| 100 | 100 | |
| 101 | 101 | // Remove the currently used channel from the channels list |
| 102 | - if(($key = array_search($currentChannel, $channels)) !== false) { |
|
| 102 | + if (($key = array_search($currentChannel, $channels)) !== false) { |
|
| 103 | 103 | unset($channels[$key]); |
| 104 | 104 | } |
| 105 | 105 | $updateState = $this->updateChecker->getUpdateState(); |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | $data = $this->updater->check(); |
| 44 | 44 | $result = []; |
| 45 | 45 | |
| 46 | - if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
| 46 | + if (isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) { |
|
| 47 | 47 | $result['updateAvailable'] = true; |
| 48 | 48 | $result['updateVersion'] = $data['versionstring']; |
| 49 | 49 | $result['updaterEnabled'] = $data['autoupdater'] === '1'; |
| 50 | - if(substr($data['web'], 0, 8) === 'https://') { |
|
| 50 | + if (substr($data['web'], 0, 8) === 'https://') { |
|
| 51 | 51 | $result['updateLink'] = $data['web']; |
| 52 | 52 | } |
| 53 | - if(substr($data['url'], 0, 8) === 'https://') { |
|
| 53 | + if (substr($data['url'], 0, 8) === 'https://') { |
|
| 54 | 54 | $result['downloadLink'] = $data['url']; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @param array $data |
| 65 | 65 | */ |
| 66 | 66 | public function getJavaScript(array $data) { |
| 67 | - $data['array']['oc_updateState'] = json_encode([ |
|
| 67 | + $data['array']['oc_updateState'] = json_encode([ |
|
| 68 | 68 | 'updateAvailable' => true, |
| 69 | 69 | 'updateVersion' => $this->getUpdateState()['updateVersion'], |
| 70 | 70 | 'updateLink' => isset($this->getUpdateState()['updateLink']) ? $this->getUpdateState()['updateLink'] : '', |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | use OCP\AppFramework\IAppContainer; |
| 31 | 31 | |
| 32 | 32 | class Application extends App { |
| 33 | - public function __construct (array $urlParams = array()) { |
|
| 33 | + public function __construct(array $urlParams = array()) { |
|
| 34 | 34 | parent::__construct('updatenotification', $urlParams); |
| 35 | 35 | $container = $this->getContainer(); |
| 36 | 36 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | protected function run($argument) { |
| 71 | 71 | // Delete old tokens after 2 days |
| 72 | - if($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
| 72 | + if ($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
| 73 | 73 | $this->config->deleteSystemValue('updater.secret'); |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | -if(\OC::$server->getConfig()->getSystemValue('updatechecker', true) === true) { |
|
| 25 | +if (\OC::$server->getConfig()->getSystemValue('updatechecker', true) === true) { |
|
| 26 | 26 | $updater = new \OC\Updater\VersionCheck( |
| 27 | 27 | \OC::$server->getHTTPClientService(), |
| 28 | 28 | \OC::$server->getConfig() |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | 34 | $userObject = \OC::$server->getUserSession()->getUser(); |
| 35 | - if($userObject !== null) { |
|
| 36 | - if(\OC::$server->getGroupManager()->isAdmin($userObject->getUID()) && |
|
| 35 | + if ($userObject !== null) { |
|
| 36 | + if (\OC::$server->getGroupManager()->isAdmin($userObject->getUID()) && |
|
| 37 | 37 | !\OC::$server->getAppManager()->isEnabledForUser('notifications')) { |
| 38 | - if($updateChecker->getUpdateState() !== []) { |
|
| 38 | + if ($updateChecker->getUpdateState() !== []) { |
|
| 39 | 39 | \OCP\Util::addScript('updatenotification', 'notification'); |
| 40 | 40 | OC_Hook::connect('\OCP\Config', 'js', $updateChecker, 'getJavaScript'); |
| 41 | 41 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $uid = $user->getUID(); |
| 80 | 80 | foreach (range(1, min([$number, 20])) as $i) { |
| 81 | - $code = $this->random->generate(self::$CODE_LENGTH, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
| 81 | + $code = $this->random->generate(self::$CODE_LENGTH, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
| 82 | 82 | |
| 83 | 83 | $dbCode = new BackupCode(); |
| 84 | 84 | $dbCode->setUserId($uid); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $codes = $this->mapper->getBackupCodes($user); |
| 133 | 133 | $total = count($codes); |
| 134 | 134 | $used = 0; |
| 135 | - array_walk($codes, function (BackupCode $code) use (&$used) { |
|
| 135 | + array_walk($codes, function(BackupCode $code) use (&$used) { |
|
| 136 | 136 | if (1 === (int) $code->getUsed()) { |
| 137 | 137 | $used++; |
| 138 | 138 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $rows = $result->fetchAll(); |
| 48 | 48 | $result->closeCursor(); |
| 49 | 49 | |
| 50 | - return array_map(function ($row) { |
|
| 50 | + return array_map(function($row) { |
|
| 51 | 51 | return BackupCode::fromRow($row); |
| 52 | 52 | }, $rows); |
| 53 | 53 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | /** @var array $_ */ |
| 4 | 4 | |
| 5 | 5 | print_unescaped($l->t("Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n", array($_['password']))); |
| 6 | -if ( isset($_['expiration']) ) { |
|
| 6 | +if (isset($_['expiration'])) { |
|
| 7 | 7 | print_unescaped($l->t("The share will expire on %s.", array($_['expiration']))); |
| 8 | 8 | print_unescaped("\n\n"); |
| 9 | 9 | } |
@@ -12,5 +12,5 @@ discard block |
||
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | -- |
| 15 | -<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?> |
|
| 15 | +<?php p($theme->getName().' - '.$theme->getSlogan()); ?> |
|
| 16 | 16 | <?php print_unescaped("\n".$theme->getBaseUrl()); |
@@ -137,13 +137,13 @@ discard block |
||
| 137 | 137 | $path = '/files_encryption/keys'; |
| 138 | 138 | $this->renameFileKeys($user, $path); |
| 139 | 139 | $trashPath = '/files_trashbin/keys'; |
| 140 | - if (\OC_App::isEnabled('files_trashbin') && $this->view->is_dir($user . '/' . $trashPath)) { |
|
| 140 | + if (\OC_App::isEnabled('files_trashbin') && $this->view->is_dir($user.'/'.$trashPath)) { |
|
| 141 | 141 | $this->renameFileKeys($user, $trashPath, true); |
| 142 | 142 | $this->view->deleteAll($trashPath); |
| 143 | 143 | } |
| 144 | 144 | // delete old folders |
| 145 | 145 | $this->deleteOldKeys($user); |
| 146 | - $this->view->getMount('/' . $user)->getStorage()->getScanner()->scan('files_encryption'); |
|
| 146 | + $this->view->getMount('/'.$user)->getStorage()->getScanner()->scan('files_encryption'); |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | while ($row = $appSettings->fetch()) { |
| 174 | 174 | // 'installed_version' gets deleted at the end of the migration process |
| 175 | - if ($row['configkey'] !== 'installed_version' ) { |
|
| 175 | + if ($row['configkey'] !== 'installed_version') { |
|
| 176 | 176 | $this->config->setAppValue('encryption', $row['configkey'], $row['configvalue']); |
| 177 | 177 | $this->config->deleteAppValue('files_encryption', $row['configkey']); |
| 178 | 178 | } |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | * create backup of system-wide keys |
| 196 | 196 | */ |
| 197 | 197 | private function backupSystemWideKeys() { |
| 198 | - $backupDir = 'encryption_migration_backup_' . date("Y-m-d_H-i-s"); |
|
| 198 | + $backupDir = 'encryption_migration_backup_'.date("Y-m-d_H-i-s"); |
|
| 199 | 199 | $this->view->mkdir($backupDir); |
| 200 | - $this->view->copy('files_encryption', $backupDir . '/files_encryption'); |
|
| 200 | + $this->view->copy('files_encryption', $backupDir.'/files_encryption'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -207,9 +207,9 @@ discard block |
||
| 207 | 207 | * @return bool |
| 208 | 208 | */ |
| 209 | 209 | private function backupUserKeys($user) { |
| 210 | - $encryptionDir = $user . '/files_encryption'; |
|
| 210 | + $encryptionDir = $user.'/files_encryption'; |
|
| 211 | 211 | if ($this->view->is_dir($encryptionDir)) { |
| 212 | - $backupDir = $user . '/encryption_migration_backup_' . date("Y-m-d_H-i-s"); |
|
| 212 | + $backupDir = $user.'/encryption_migration_backup_'.date("Y-m-d_H-i-s"); |
|
| 213 | 213 | $this->view->mkdir($backupDir); |
| 214 | 214 | $this->view->copy($encryptionDir, $backupDir); |
| 215 | 215 | return true; |
@@ -222,12 +222,12 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | private function renameSystemPrivateKeys() { |
| 224 | 224 | $dh = $this->view->opendir('files_encryption'); |
| 225 | - $this->createPathForKeys('/files_encryption/' . $this->moduleId ); |
|
| 225 | + $this->createPathForKeys('/files_encryption/'.$this->moduleId); |
|
| 226 | 226 | if (is_resource($dh)) { |
| 227 | 227 | while (($privateKey = readdir($dh)) !== false) { |
| 228 | - if (!\OC\Files\Filesystem::isIgnoredDir($privateKey) ) { |
|
| 229 | - if (!$this->view->is_dir('/files_encryption/' . $privateKey)) { |
|
| 230 | - $this->view->rename('files_encryption/' . $privateKey, 'files_encryption/' . $this->moduleId . '/' . $privateKey); |
|
| 228 | + if (!\OC\Files\Filesystem::isIgnoredDir($privateKey)) { |
|
| 229 | + if (!$this->view->is_dir('/files_encryption/'.$privateKey)) { |
|
| 230 | + $this->view->rename('files_encryption/'.$privateKey, 'files_encryption/'.$this->moduleId.'/'.$privateKey); |
|
| 231 | 231 | $this->renameSystemPublicKey($privateKey); |
| 232 | 232 | } |
| 233 | 233 | } |
@@ -242,8 +242,8 @@ discard block |
||
| 242 | 242 | * @param string $privateKey private key for which we want to rename the corresponding public key |
| 243 | 243 | */ |
| 244 | 244 | private function renameSystemPublicKey($privateKey) { |
| 245 | - $publicKey = substr($privateKey,0 , strrpos($privateKey, '.privateKey')) . '.publicKey'; |
|
| 246 | - $this->view->rename('files_encryption/public_keys/' . $publicKey, 'files_encryption/' . $this->moduleId . '/' . $publicKey); |
|
| 245 | + $publicKey = substr($privateKey, 0, strrpos($privateKey, '.privateKey')).'.publicKey'; |
|
| 246 | + $this->view->rename('files_encryption/public_keys/'.$publicKey, 'files_encryption/'.$this->moduleId.'/'.$publicKey); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /** |
@@ -252,8 +252,8 @@ discard block |
||
| 252 | 252 | * @param string $user |
| 253 | 253 | */ |
| 254 | 254 | private function renameUsersPrivateKey($user) { |
| 255 | - $oldPrivateKey = $user . '/files_encryption/' . $user . '.privateKey'; |
|
| 256 | - $newPrivateKey = $user . '/files_encryption/' . $this->moduleId . '/' . $user . '.privateKey'; |
|
| 255 | + $oldPrivateKey = $user.'/files_encryption/'.$user.'.privateKey'; |
|
| 256 | + $newPrivateKey = $user.'/files_encryption/'.$this->moduleId.'/'.$user.'.privateKey'; |
|
| 257 | 257 | if ($this->view->file_exists($oldPrivateKey)) { |
| 258 | 258 | $this->createPathForKeys(dirname($newPrivateKey)); |
| 259 | 259 | $this->view->rename($oldPrivateKey, $newPrivateKey); |
@@ -266,8 +266,8 @@ discard block |
||
| 266 | 266 | * @param string $user |
| 267 | 267 | */ |
| 268 | 268 | private function renameUsersPublicKey($user) { |
| 269 | - $oldPublicKey = '/files_encryption/public_keys/' . $user . '.publicKey'; |
|
| 270 | - $newPublicKey = $user . '/files_encryption/' . $this->moduleId . '/' . $user . '.publicKey'; |
|
| 269 | + $oldPublicKey = '/files_encryption/public_keys/'.$user.'.publicKey'; |
|
| 270 | + $newPublicKey = $user.'/files_encryption/'.$this->moduleId.'/'.$user.'.publicKey'; |
|
| 271 | 271 | if ($this->view->file_exists($oldPublicKey)) { |
| 272 | 272 | $this->createPathForKeys(dirname($newPublicKey)); |
| 273 | 273 | $this->view->rename($oldPublicKey, $newPublicKey); |
@@ -283,27 +283,27 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | private function renameFileKeys($user, $path, $trash = false) { |
| 285 | 285 | |
| 286 | - if ($this->view->is_dir($user . '/' . $path) === false) { |
|
| 287 | - $this->logger->info('Skip dir /' . $user . '/' . $path . ': does not exist'); |
|
| 286 | + if ($this->view->is_dir($user.'/'.$path) === false) { |
|
| 287 | + $this->logger->info('Skip dir /'.$user.'/'.$path.': does not exist'); |
|
| 288 | 288 | return; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - $dh = $this->view->opendir($user . '/' . $path); |
|
| 291 | + $dh = $this->view->opendir($user.'/'.$path); |
|
| 292 | 292 | |
| 293 | 293 | if (is_resource($dh)) { |
| 294 | 294 | while (($file = readdir($dh)) !== false) { |
| 295 | 295 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
| 296 | - if ($this->view->is_dir($user . '/' . $path . '/' . $file)) { |
|
| 297 | - $this->renameFileKeys($user, $path . '/' . $file, $trash); |
|
| 296 | + if ($this->view->is_dir($user.'/'.$path.'/'.$file)) { |
|
| 297 | + $this->renameFileKeys($user, $path.'/'.$file, $trash); |
|
| 298 | 298 | } else { |
| 299 | 299 | $target = $this->getTargetDir($user, $path, $file, $trash); |
| 300 | 300 | if ($target !== false) { |
| 301 | 301 | $this->createPathForKeys(dirname($target)); |
| 302 | - $this->view->rename($user . '/' . $path . '/' . $file, $target); |
|
| 302 | + $this->view->rename($user.'/'.$path.'/'.$file, $target); |
|
| 303 | 303 | } else { |
| 304 | 304 | $this->logger->warning( |
| 305 | - 'did not move key "' . $file |
|
| 306 | - . '" could not find the corresponding file in /data/' . $user . '/files.' |
|
| 305 | + 'did not move key "'.$file |
|
| 306 | + . '" could not find the corresponding file in /data/'.$user.'/files.' |
|
| 307 | 307 | . 'Most likely the key was already moved in a previous migration run and is already on the right place.'); |
| 308 | 308 | } |
| 309 | 309 | } |
@@ -336,10 +336,10 @@ discard block |
||
| 336 | 336 | private function getTargetDir($user, $keyPath, $filename, $trash) { |
| 337 | 337 | if ($trash) { |
| 338 | 338 | $filePath = substr($keyPath, strlen('/files_trashbin/keys/')); |
| 339 | - $targetDir = $user . '/files_encryption/keys/files_trashbin/' . $filePath . '/' . $this->moduleId . '/' . $filename; |
|
| 339 | + $targetDir = $user.'/files_encryption/keys/files_trashbin/'.$filePath.'/'.$this->moduleId.'/'.$filename; |
|
| 340 | 340 | } else { |
| 341 | 341 | $filePath = substr($keyPath, strlen('/files_encryption/keys/')); |
| 342 | - $targetDir = $user . '/files_encryption/keys/files/' . $filePath . '/' . $this->moduleId . '/' . $filename; |
|
| 342 | + $targetDir = $user.'/files_encryption/keys/files/'.$filePath.'/'.$this->moduleId.'/'.$filename; |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | if ($user === '') { |
@@ -347,13 +347,13 @@ discard block |
||
| 347 | 347 | $normalized = \OC\Files\Filesystem::normalizePath($filePath); |
| 348 | 348 | $systemMountPoints = $this->getSystemMountPoints(); |
| 349 | 349 | foreach ($systemMountPoints as $mountPoint) { |
| 350 | - $normalizedMountPoint = \OC\Files\Filesystem::normalizePath($mountPoint['mountpoint']) . '/'; |
|
| 350 | + $normalizedMountPoint = \OC\Files\Filesystem::normalizePath($mountPoint['mountpoint']).'/'; |
|
| 351 | 351 | if (strpos($normalized, $normalizedMountPoint) === 0) |
| 352 | 352 | return $targetDir; |
| 353 | 353 | } |
| 354 | - } else if ($trash === false && $this->view->file_exists('/' . $user. '/files/' . $filePath)) { |
|
| 354 | + } else if ($trash === false && $this->view->file_exists('/'.$user.'/files/'.$filePath)) { |
|
| 355 | 355 | return $targetDir; |
| 356 | - } else if ($trash === true && $this->view->file_exists('/' . $user. '/files_trashbin/' . $filePath)) { |
|
| 356 | + } else if ($trash === true && $this->view->file_exists('/'.$user.'/files_trashbin/'.$filePath)) { |
|
| 357 | 357 | return $targetDir; |
| 358 | 358 | } |
| 359 | 359 | |
@@ -366,8 +366,8 @@ discard block |
||
| 366 | 366 | * @param string $user |
| 367 | 367 | */ |
| 368 | 368 | private function deleteOldKeys($user) { |
| 369 | - $this->view->deleteAll($user . '/files_encryption/keyfiles'); |
|
| 370 | - $this->view->deleteAll($user . '/files_encryption/share-keys'); |
|
| 369 | + $this->view->deleteAll($user.'/files_encryption/keyfiles'); |
|
| 370 | + $this->view->deleteAll($user.'/files_encryption/share-keys'); |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | $sub_dirs = explode('/', $path); |
| 381 | 381 | $dir = ''; |
| 382 | 382 | foreach ($sub_dirs as $sub_dir) { |
| 383 | - $dir .= '/' . $sub_dir; |
|
| 383 | + $dir .= '/'.$sub_dir; |
|
| 384 | 384 | if (!$this->view->is_dir($dir)) { |
| 385 | 385 | $this->view->mkdir($dir); |
| 386 | 386 | } |