diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-04-29 12:15:11 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-04-29 12:15:11 +0200 |
commit | 6b02126dc1c8ba9de5b87c6c8568feea5948d2a0 (patch) | |
tree | 90f8d6372232858ee0bba4b00275a6303677a4fc /apps/files_encryption/lib | |
parent | b95aa43a5d1dac3e1ca8f3c55e050861d7a4938b (diff) | |
parent | 73a2d87ab4db9058c1e34539abe023c85a461584 (diff) | |
download | nextcloud-server-6b02126dc1c8ba9de5b87c6c8568feea5948d2a0.tar.gz nextcloud-server-6b02126dc1c8ba9de5b87c6c8568feea5948d2a0.zip |
Merge pull request #8382 from owncloud/enc_fix_decrypt_all
fix shouldEncrypt() method and improved decryptAll() unit tests
Diffstat (limited to 'apps/files_encryption/lib')
-rw-r--r-- | apps/files_encryption/lib/proxy.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index ae2d8d63e23..03ddc795eae 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -53,10 +53,11 @@ class Proxy extends \OC_FileProxy { private static function shouldEncrypt($path, $mode = 'w') { $userId = Helper::getUser($path); + $session = new Session(new \OC\Files\View()); // don't call the crypt stream wrapper, if... if ( - \OCP\App::isEnabled('files_encryption') === false // encryption is disabled + $session->getInitialized() !== Session::INIT_SUCCESSFUL // encryption successful initialized || Crypt::mode() !== 'server' // we are not in server-side-encryption mode || strpos($path, '/' . $userId . '/files') !== 0 // path is not in files/ || substr($path, 0, 8) === 'crypt://' // we are already in crypt mode |