diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-03-31 16:25:33 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-03-31 16:25:33 +0200 |
commit | bac9b54befcb609d5b96f63a070e212fcb83ec3c (patch) | |
tree | 882924d03c2d4077438f7cfd3a94289df80dfe47 /lib/base.php | |
parent | 1d06d93d271210793baf575414ff0dd8f576dae0 (diff) | |
download | nextcloud-server-bac9b54befcb609d5b96f63a070e212fcb83ec3c.tar.gz nextcloud-server-bac9b54befcb609d5b96f63a070e212fcb83ec3c.zip |
Add mount point to disable the encryption wrapper
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/base.php b/lib/base.php index b441d5f1927..98da75b61a8 100644 --- a/lib/base.php +++ b/lib/base.php @@ -703,14 +703,18 @@ class OC { private static function registerEncryptionWrapper() { $enabled = self::$server->getEncryptionManager()->isEnabled(); if ($enabled) { - \OC\Files\Filesystem::addStorageWrapper('oc_encryption', function ($mountPoint, $storage) { - $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); + \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; + } }); } |