get mount point from mount manager
This commit is contained in:
parent
09645b9221
commit
9ed5083efd
|
@ -320,14 +320,9 @@ class Hooks {
|
||||||
|
|
||||||
$sharingEnabled = \OCP\Share::isEnabled();
|
$sharingEnabled = \OCP\Share::isEnabled();
|
||||||
|
|
||||||
// get the path including mount point only if not a shared folder
|
$mountManager = \OC\Files\Filesystem::getMountManager();
|
||||||
list($storage, ) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/files' . $path);
|
$mount = $mountManager->find('/' . $userId . '/files' . $path);
|
||||||
|
$mountPoint = $mount->getMountPoint();
|
||||||
if (!($storage instanceof \OC\Files\Storage\Local)) {
|
|
||||||
$mountPoint = 'files' . $storage->getMountPoint();
|
|
||||||
} else {
|
|
||||||
$mountPoint = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// if a folder was shared, get a list of all (sub-)folders
|
// if a folder was shared, get a list of all (sub-)folders
|
||||||
if ($params['itemType'] === 'folder') {
|
if ($params['itemType'] === 'folder') {
|
||||||
|
@ -370,14 +365,9 @@ class Hooks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the path including mount point only if not a shared folder
|
$mountManager = \OC\Files\Filesystem::getMountManager();
|
||||||
list($storage, ) = \OC\Files\Filesystem::resolvePath('/' . $userId . '/files' . $path);
|
$mount = $mountManager->find('/' . $userId . '/files' . $path);
|
||||||
|
$mountPoint = $mount->getMountPoint();
|
||||||
if (!($storage instanceof \OC\Files\Storage\Local)) {
|
|
||||||
$mountPoint = 'files' . $storage->getMountPoint();
|
|
||||||
} else {
|
|
||||||
$mountPoint = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// if we unshare a folder we need a list of all (sub-)files
|
// if we unshare a folder we need a list of all (sub-)files
|
||||||
if ($params['itemType'] === 'folder') {
|
if ($params['itemType'] === 'folder') {
|
||||||
|
|
|
@ -1384,10 +1384,11 @@ class Util {
|
||||||
// getDirectoryContent() returns the paths relative to the mount points, so we need
|
// getDirectoryContent() returns the paths relative to the mount points, so we need
|
||||||
// to re-construct the complete path
|
// to re-construct the complete path
|
||||||
$path = ($mountPoint !== '') ? $mountPoint . '/' . $c['path'] : $c['path'];
|
$path = ($mountPoint !== '') ? $mountPoint . '/' . $c['path'] : $c['path'];
|
||||||
|
$path = \OC\Files\Filesystem::normalizePath($path);
|
||||||
if ($c['type'] === 'dir') {
|
if ($c['type'] === 'dir') {
|
||||||
$dirList[] = substr($path, strlen("files"));
|
$dirList[] = substr($path, strlen('/' . \OCP\User::getUser() . "/files"));
|
||||||
} else {
|
} else {
|
||||||
$result[] = substr($path, strlen("files"));
|
$result[] = substr($path, strlen('/' . \OCP\User::getUser() . "/files"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue