summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2014-05-29 17:52:28 +0100
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2014-05-29 17:52:28 +0100
commit32a50563d3a93c304d7879212f349e6930d5b5d6 (patch)
tree43dab4dc5f3f797a4872f5e6131cbb04f3f39064 /apps/files_encryption
parentb8059fbc862ff134a35818515fe5921ed01d4efd (diff)
parent9ed5083efd2e150cf5856160b0ff73744eb697d2 (diff)
downloadnextcloud-server-32a50563d3a93c304d7879212f349e6930d5b5d6.tar.gz
nextcloud-server-32a50563d3a93c304d7879212f349e6930d5b5d6.zip
Merge pull request #8771 from owncloud/enc_get_mount_from_mountmanager
get mount point from mount manager
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/hooks/hooks.php22
-rw-r--r--apps/files_encryption/lib/util.php5
2 files changed, 9 insertions, 18 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 6e375f99a8e..f2096c3956e 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -320,14 +320,9 @@ class Hooks {
$sharingEnabled = \OCP\Share::isEnabled();
- // get the path including mount point only if not a shared folder
- list($storage, ) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/files' . $path);
-
- if (!($storage instanceof \OC\Files\Storage\Local)) {
- $mountPoint = 'files' . $storage->getMountPoint();
- } else {
- $mountPoint = '';
- }
+ $mountManager = \OC\Files\Filesystem::getMountManager();
+ $mount = $mountManager->find('/' . $userId . '/files' . $path);
+ $mountPoint = $mount->getMountPoint();
// if a folder was shared, get a list of all (sub-)folders
if ($params['itemType'] === 'folder') {
@@ -370,14 +365,9 @@ class Hooks {
}
}
- // get the path including mount point only if not a shared folder
- list($storage, ) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/files' . $path);
-
- if (!($storage instanceof \OC\Files\Storage\Local)) {
- $mountPoint = 'files' . $storage->getMountPoint();
- } else {
- $mountPoint = '';
- }
+ $mountManager = \OC\Files\Filesystem::getMountManager();
+ $mount = $mountManager->find('/' . $userId . '/files' . $path);
+ $mountPoint = $mount->getMountPoint();
// if we unshare a folder we need a list of all (sub-)files
if ($params['itemType'] === 'folder') {
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index d20efc3ac7b..991960b7fa9 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1384,10 +1384,11 @@ class Util {
// getDirectoryContent() returns the paths relative to the mount points, so we need
// to re-construct the complete path
$path = ($mountPoint !== '') ? $mountPoint . '/' . $c['path'] : $c['path'];
+ $path = \OC\Files\Filesystem::normalizePath($path);
if ($c['type'] === 'dir') {
- $dirList[] = substr($path, strlen("files"));
+ $dirList[] = substr($path, strlen('/' . \OCP\User::getUser() . "/files"));
} else {
- $result[] = substr($path, strlen("files"));
+ $result[] = substr($path, strlen('/' . \OCP\User::getUser() . "/files"));
}
}