From 73a2d87ab4db9058c1e34539abe023c85a461584 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 28 Apr 2014 14:40:10 +0200 Subject: fix shouldEncrypt() method and improved decryptAll() unit tests --- apps/files_encryption/lib/proxy.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/files_encryption/lib') 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 -- cgit v1.2.3