diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-06-23 16:14:52 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-06-25 12:27:30 +0200 |
commit | 709691548dbf72c5763879136f3a0ba4e8a0c135 (patch) | |
tree | 2bffd7b28c99c764d8d025b7b67616e821351437 /apps/files_encryption/lib | |
parent | 89f26915152e5aaf357b2aa633d5bea954e4bcc2 (diff) | |
download | nextcloud-server-709691548dbf72c5763879136f3a0ba4e8a0c135.tar.gz nextcloud-server-709691548dbf72c5763879136f3a0ba4e8a0c135.zip |
always use oc filesystem for rename operation
Diffstat (limited to 'apps/files_encryption/lib')
-rwxr-xr-x | apps/files_encryption/lib/helper.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 2684bf7be33..c6f18602b2b 100755 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -439,6 +439,30 @@ class Helper { } /** + * find all share keys for a given file + * @param string $path to the file + * @param \OC\Files\View $view view, relative to data/ + */ + public static function findShareKeys($path, $view) { + $result = array(); + $pathinfo = pathinfo($path); + $dirContent = $view->opendir($pathinfo['dirname']); + + if (is_resource($dirContent)) { + while (($file = readdir($dirContent)) !== false) { + if (!\OC\Files\Filesystem::isIgnoredDir($file)) { + if (preg_match("/" . $pathinfo['filename'] . ".(.*).shareKey/", $file)) { + $result[] = $pathinfo['dirname'] . '/' . $file; + } + } + } + closedir($dirContent); + } + + return $result; + } + + /** * remember from which file the tmp file (getLocalFile() call) was created * @param string $tmpFile path of tmp file * @param string $originalFile path of the original file relative to data/ |