summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-04-01 10:37:48 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:29 +0200
commit83cb382b3fb919bc7ce2d4e7f1fea027c3867460 (patch)
treefd483f185b493ff867af2d8b25f6657681495d69 /lib
parentd90663704cc9bd1940374ca15519d5cbe1e7ca4e (diff)
downloadnextcloud-server-83cb382b3fb919bc7ce2d4e7f1fea027c3867460.tar.gz
nextcloud-server-83cb382b3fb919bc7ce2d4e7f1fea027c3867460.zip
pass file helper to encryption wrapper
Diffstat (limited to 'lib')
-rw-r--r--lib/private/encryption/manager.php3
-rw-r--r--lib/private/files/storage/wrapper/encryption.php8
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/encryption/manager.php b/lib/private/encryption/manager.php
index cf11c3cf335..77f02b0c489 100644
--- a/lib/private/encryption/manager.php
+++ b/lib/private/encryption/manager.php
@@ -194,7 +194,8 @@ class Manager implements \OCP\Encryption\IManager {
$user = \OC::$server->getUserSession()->getUser();
$logger = \OC::$server->getLogger();
$uid = $user ? $user->getUID() : null;
- return new Encryption($parameters, $manager, $util, $logger, $uid);
+ $fileHelper = \OC::$server->getEncryptionFilesHelper();
+ return new Encryption($parameters, $manager, $util, $logger, $fileHelper, $uid);
});
}
}
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index cea7a38d41b..43052af8448 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -45,11 +45,15 @@ class Encryption extends Wrapper {
/** @var array */
private $unencryptedSize;
+ /** @var \OC\Encryption\File */
+ private $fileHelper;
+
/**
* @param array $parameters
* @param \OC\Encryption\Manager $encryptionManager
* @param \OC\Encryption\Util $util
* @param \OC\Log $logger
+ * @param \OC\Encryption\File $fileHelper
* @param string $uid user who perform the read/write operation (null for public access)
*/
public function __construct(
@@ -57,6 +61,7 @@ class Encryption extends Wrapper {
\OC\Encryption\Manager $encryptionManager = null,
\OC\Encryption\Util $util = null,
\OC\Log $logger = null,
+ \OC\Encryption\File $fileHelper = null,
$uid = null
) {
@@ -65,6 +70,7 @@ class Encryption extends Wrapper {
$this->util = $util;
$this->logger = $logger;
$this->uid = $uid;
+ $this->fileHelper = $fileHelper;
$this->unencryptedSize = array();
parent::__construct($parameters);
}
@@ -250,7 +256,7 @@ class Encryption extends Wrapper {
$uid = $owner;
}
$handle = \OC\Files\Stream\Encryption::wrap($source, $path, $fullPath, $header,
- $uid, $encryptionModule, $this->storage, $this, $this->util, $mode,
+ $uid, $encryptionModule, $this->storage, $this, $this->util, $this->fileHelper, $mode,
$size, $unencryptedSize);
return $handle;
} else {