reformat code
This commit is contained in:
parent
1e601cd6f1
commit
dc8bcf0688
|
@ -58,7 +58,8 @@ class Hooks {
|
|||
$privateKey = Crypt::decryptPrivateKey($encryptedKey, $params['password']);
|
||||
|
||||
if ($privateKey === false) {
|
||||
\OCP\Util::writeLog('Encryption library', 'Private key for user "' . $params['uid'] . '" is not valid! Maybe the user password was changed from outside if so please change it back to gain access', \OCP\Util::ERROR);
|
||||
\OCP\Util::writeLog('Encryption library', 'Private key for user "' . $params['uid']
|
||||
. '" is not valid! Maybe the user password was changed from outside if so please change it back to gain access', \OCP\Util::ERROR);
|
||||
}
|
||||
|
||||
$session = new \OCA\Encryption\Session($view);
|
||||
|
|
|
@ -88,7 +88,8 @@ class Session {
|
|||
$proxyStatus = \OC_FileProxy::$enabled;
|
||||
\OC_FileProxy::$enabled = false;
|
||||
|
||||
$encryptedKey = $this->view->file_get_contents( '/owncloud_private_key/' . $publicShareKeyId . '.private.key' );
|
||||
$encryptedKey = $this->view->file_get_contents(
|
||||
'/owncloud_private_key/' . $publicShareKeyId . '.private.key');
|
||||
$privateKey = Crypt::decryptPrivateKey($encryptedKey, '');
|
||||
$this->setPublicSharePrivateKey($privateKey);
|
||||
|
||||
|
|
|
@ -573,7 +573,9 @@ class Util {
|
|||
// get relative path
|
||||
$relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path);
|
||||
|
||||
if (isset($pathParts[2]) && $pathParts[2] === 'files' && $this->view->file_exists($path) && $this->isEncryptedPath($path)) {
|
||||
if (isset($pathParts[2]) && $pathParts[2] === 'files' && $this->view->file_exists($path)
|
||||
&& $this->isEncryptedPath($path)
|
||||
) {
|
||||
|
||||
// get the size from filesystem
|
||||
$fullPath = $this->view->getLocalFile($path);
|
||||
|
@ -708,7 +710,11 @@ class Util {
|
|||
$this->view->chroot($fakeRoot);
|
||||
|
||||
// Add the file to the cache
|
||||
\OC\Files\Filesystem::putFileInfo( $relPath, array( 'encrypted' => true, 'size' => $size, 'unencrypted_size' => $size ) );
|
||||
\OC\Files\Filesystem::putFileInfo($relPath, array(
|
||||
'encrypted' => true,
|
||||
'size' => $size,
|
||||
'unencrypted_size' => $size
|
||||
));
|
||||
}
|
||||
|
||||
// Encrypt legacy encrypted files
|
||||
|
@ -1191,7 +1197,8 @@ class Util {
|
|||
|
||||
$result = array();
|
||||
|
||||
$content = $this->view->getDirectoryContent(\OC\Files\Filesystem::normalizePath($this->userFilesDir . '/' . $dir));
|
||||
$content = $this->view->getDirectoryContent(\OC\Files\Filesystem::normalizePath(
|
||||
$this->userFilesDir . '/' . $dir));
|
||||
|
||||
// handling for re shared folders
|
||||
$pathSplit = explode('/', $dir);
|
||||
|
|
|
@ -26,7 +26,7 @@ $recoveryEnabledForUser = $util->recoveryEnabledForUser();
|
|||
|
||||
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);
|
||||
$tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser);
|
||||
$tmpl->assign("privateKeySet" , $privateKeySet);
|
||||
$tmpl->assign('privateKeySet', $privateKeySet);
|
||||
|
||||
return $tmpl->fetchPage();
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<strong><?php p($l->t('Encryption')); ?></strong>
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php p($l->t("Enable encryption passwords recovery key (allow sharing to recovery key):")); ?>
|
||||
<br/>
|
||||
|
@ -28,6 +29,7 @@
|
|||
<?php p($l->t("Disabled")); ?>
|
||||
</p>
|
||||
<br/><br/>
|
||||
|
||||
<p>
|
||||
<strong><?php p($l->t("Change encryption passwords recovery key:")); ?></strong>
|
||||
<br/><br/>
|
||||
|
|
|
@ -92,8 +92,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
|
|||
// reset app files_trashbin
|
||||
if ($this->stateFilesTrashbin) {
|
||||
OC_App::enable('files_trashbin');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
OC_App::disable('files_trashbin');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,8 +111,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
|
|||
// reset app files_trashbin
|
||||
if ($this->stateFilesTrashbin) {
|
||||
OC_App::enable('files_trashbin');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
OC_App::disable('files_trashbin');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue