diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-29 19:11:39 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-29 19:11:39 +0200 |
commit | d2652645425777c1a97f8421e51aad9bdcf39684 (patch) | |
tree | 4fa7ce7d05060755361a77f49684e1c226653a6f /apps/files_encryption/lib/util.php | |
parent | ae0f37e9e20a540ed93b99814f4eb066bd26aa88 (diff) | |
download | nextcloud-server-d2652645425777c1a97f8421e51aad9bdcf39684.tar.gz nextcloud-server-d2652645425777c1a97f8421e51aad9bdcf39684.zip |
fix for share folder on external storage
Diffstat (limited to 'apps/files_encryption/lib/util.php')
-rw-r--r-- | apps/files_encryption/lib/util.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index 0ff76e60580..64d7e9e5842 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -1199,7 +1199,7 @@ class Util { $result = array(); - $content = $this->view->getDirectoryContent($this->userFilesDir . $dir); + $content = $this->view->getDirectoryContent(\OC\Files\Filesystem::normalizePath($this->userFilesDir . '/' . $dir)); // handling for re shared folders $path_split = explode('/', $dir); @@ -1531,4 +1531,22 @@ class Util { $this->recoverAllFiles('/', $privateKey); } + /** + * Get the path including the storage mount point + * @param int $id + * @return string the path including the mount point like AmazonS3/folder/file.txt + */ + public function getPathWithMountPoint($id) { + list($storage, $internalPath) = \OC\Files\Cache\Cache::getById($id); + $mount = \OC\Files\Filesystem::getMountByStorageId($storage); + $mountPoint = $mount[0]->getMountPoint(); + $path = \OC\Files\Filesystem::normalizePath($mountPoint.'/'.$internalPath); + + // reformat the path to be relative e.g. /user/files/folder becomes /folder/ + $pathSplit = explode( '/', $path ); + $relativePath = implode( '/', array_slice( $pathSplit, 3 ) ); + + return $relativePath; + } + } |