summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/stream.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-10 11:03:07 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-07-29 13:36:06 +0200
commit2c8e5ec84ff98088fb9e3b275735098beaa5e27f (patch)
treee0cf14263f97b2b3296ca52a6422dbe74b0ad598 /apps/files_encryption/lib/stream.php
parent48621115c10f62f776dbe41ad9a51c1ac360fc8c (diff)
downloadnextcloud-server-2c8e5ec84ff98088fb9e3b275735098beaa5e27f.tar.gz
nextcloud-server-2c8e5ec84ff98088fb9e3b275735098beaa5e27f.zip
user interface to allow user to decrypt all his files once the encryption app was disabled
Conflicts: settings/templates/personal.php
Diffstat (limited to 'apps/files_encryption/lib/stream.php')
-rw-r--r--apps/files_encryption/lib/stream.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index 3c1eb2c5f5e..2f7af1410b9 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -73,7 +73,7 @@ class Stream {
private $privateKey;
/**
- * @param $path
+ * @param $path raw path relative to data/
* @param $mode
* @param $options
* @param $opened_path
@@ -93,12 +93,16 @@ class Stream {
$this->userId = $util->getUserId();
- // Strip identifier text from path, this gives us the path relative to data/<user>/files
- $this->relPath = \OC\Files\Filesystem::normalizePath(str_replace('crypt://', '', $path));
-
// rawPath is relative to the data directory
- $this->rawPath = $util->getUserFilesDir() . $this->relPath;
+ $this->rawPath = \OC\Files\Filesystem::normalizePath(str_replace('crypt://', '', $path));
+ // Strip identifier text from path, this gives us the path relative to data/<user>/files
+ $this->relPath = Helper::stripUserFilesPath($this->rawPath);
+ // if raw path doesn't point to a real file, check if it is a version or a file in the trash bin
+ if ($this->relPath === false) {
+ $this->relPath = Helper::getPathToRealFile($this->rawPath);
+ }
+
// Disable fileproxies so we can get the file size and open the source file without recursive encryption
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;