aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/util.php
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-22 00:53:07 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-22 00:54:47 +0200
commit9ca9a22c6a6495e657290195c97282aee8976282 (patch)
tree85d0a4b9f48422e792966c2e3b77909eaa7b347a /apps/files_encryption/lib/util.php
parent095fc790ac28f7fa3fb0e30808b81d270f7e13d6 (diff)
downloadnextcloud-server-9ca9a22c6a6495e657290195c97282aee8976282.tar.gz
nextcloud-server-9ca9a22c6a6495e657290195c97282aee8976282.zip
fixed finding encrypted files in subfolders and removed unused code
Diffstat (limited to 'apps/files_encryption/lib/util.php')
-rw-r--r--apps/files_encryption/lib/util.php40
1 files changed, 5 insertions, 35 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 8147982d483..1f4609ae2f6 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -367,14 +367,16 @@ class Util
* @note $directory needs to be a path relative to OC data dir. e.g.
* /admin/files NOT /backup OR /home/www/oc/data/admin/files
*/
- public function findEncFiles($directory)
+ public function findEncFiles($directory, &$found = false)
{
// Disable proxy - we don't want files to be decrypted before
// we handle them
\OC_FileProxy::$enabled = false;
- $found = array('plain' => array(), 'encrypted' => array(), 'legacy' => array());
+ if($found == false) {
+ $found = array('plain' => array(), 'encrypted' => array(), 'legacy' => array());
+ }
if (
$this->view->is_dir($directory)
@@ -395,7 +397,7 @@ class Util
// its contents
if ($this->view->is_dir($filePath)) {
- $this->findEncFiles($filePath);
+ $this->findEncFiles($filePath, $found);
// If the path is a file, determine
// its encryption status
@@ -637,38 +639,6 @@ class Util
}
/**
- * @brief Format a path to be relative to the /user directory
- * @note e.g. turns '/admin/files/test.txt' into 'files/test.txt'
- */
- public function stripFilesPath($path)
- {
-
- $trimmed = ltrim($path, '/');
- $split = explode('/', $trimmed);
- $sliced = array_slice($split, 1);
- $relPath = implode('/', $sliced);
-
- return $relPath;
-
- }
-
- /**
- * @brief Format a shared path to be relative to the /user/files/ directory
- * @note Expects a path like /uid/files/Shared/filepath
- */
- public function stripSharedFilePath($path)
- {
-
- $trimmed = ltrim($path, '/');
- $split = explode('/', $trimmed);
- $sliced = array_slice($split, 3);
- $relPath = implode('/', $sliced);
-
- return $relPath;
-
- }
-
- /**
* @param $path
* @return bool
*/