summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/proxy.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-04-28 14:40:10 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-04-28 14:49:19 +0200
commit73a2d87ab4db9058c1e34539abe023c85a461584 (patch)
tree3c10f310118274bdfc26c4989ea3e9bf11683a35 /apps/files_encryption/lib/proxy.php
parent727e3e2359602be975b4a6168a8f8d99ce838e3d (diff)
downloadnextcloud-server-73a2d87ab4db9058c1e34539abe023c85a461584.tar.gz
nextcloud-server-73a2d87ab4db9058c1e34539abe023c85a461584.zip
fix shouldEncrypt() method and improved decryptAll() unit tests
Diffstat (limited to 'apps/files_encryption/lib/proxy.php')
-rw-r--r--apps/files_encryption/lib/proxy.php3
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