fix lib/private/encryption/util.php call

This commit is contained in:
Bjoern Schiessle 2015-03-30 10:37:31 +02:00 committed by Thomas Müller
parent 48fc3f3afe
commit 937efe856d
3 changed files with 23 additions and 14 deletions

View File

@ -704,17 +704,20 @@ class OC {
$enabled = self::$server->getEncryptionManager()->isEnabled();
if ($enabled) {
\OC\Files\Filesystem::addStorageWrapper('oc_encryption', function ($mountPoint, $storage, \OCP\Files\Mount\IMountPoint $mount) {
if($mount->getOption('encrypt', true)) {
$parameters = array('storage' => $storage, 'mountPoint' => $mountPoint);
$manager = \OC::$server->getEncryptionManager();
$util = new \OC\Encryption\Util(new \OC\Files\View(), \OC::$server->getUserManager());
$user = \OC::$server->getUserSession()->getUser();
$logger = \OC::$server->getLogger();
$uid = $user ? $user->getUID() : null;
return new \OC\Files\Storage\Wrapper\Encryption($parameters, $manager, $util, $logger, $uid);
} else {
return $storage;
}
$parameters = [
'storage' => $storage,
'mountPoint' => $mountPoint,
'mount' => $mount];
$manager = \OC::$server->getEncryptionManager();
$util = new \OC\Encryption\Util(
new \OC\Files\View(),
\OC::$server->getUserManager(),
\OC::$server->getConfig());
$user = \OC::$server->getUserSession()->getUser();
$logger = \OC::$server->getLogger();
$uid = $user ? $user->getUID() : null;
return new \OC\Files\Storage\Wrapper\Encryption($parameters, $manager, $util, $logger, $uid);
});
}
@ -730,7 +733,10 @@ class OC {
}
$updater = new \OC\Encryption\Update(
new \OC\Files\View(),
new \OC\Encryption\Util(new \OC\Files\View(), \OC::$server->getUserManager()),
new \OC\Encryption\Util(
new \OC\Files\View(),
\OC::$server->getUserManager(),
\OC::$server->getConfig()),
\OC\Files\Filesystem::getMountManager(),
\OC::$server->getEncryptionManager(),
$uid

View File

@ -66,7 +66,10 @@ class Util {
protected $excludedPaths;
/**
* @param \OC\Files\View $view root view
*
* @param \OC\Files\View $view
* @param \OC\User\Manager $userManager
* @param IConfig $config
*/
public function __construct(
\OC\Files\View $view,

View File

@ -414,7 +414,7 @@ class Server extends SimpleContainer implements IServerContainer {
*/
function getEncryptionKeyStorage($encryptionModuleId) {
$view = new \OC\Files\View();
$util = new \OC\Encryption\Util($view, \OC::$server->getUserManager());
$util = new \OC\Encryption\Util($view, \OC::$server->getUserManager(), \OC::$server->getConfig());
return $this->query('EncryptionKeyStorageFactory')->get($encryptionModuleId, $view, $util);
}