summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-05-22 01:52:55 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-06 09:55:59 +0200
commit4fbc991ea2bd66f1f918c9c6abf501ca767a8a8d (patch)
tree8160191ae2b0e1c86e7ab49128f95429948deff7
parent14ce44acc8c44ebf669c46496c6b17524b3e2a4e (diff)
downloadnextcloud-server-4fbc991ea2bd66f1f918c9c6abf501ca767a8a8d.tar.gz
nextcloud-server-4fbc991ea2bd66f1f918c9c6abf501ca767a8a8d.zip
Add the removing logic for mounts
-rw-r--r--lib/private/files/view.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index a2188f393fa..1515769116f 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -359,11 +359,15 @@ class View {
$postFix = (substr($path, -1, 1) === '/') ? '/' : '';
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
$mount = Filesystem::getMountManager()->find($absolutePath . $postFix);
- if (!($mount instanceof MoveableMount) && $mount->getInternalPath($absolutePath) === '') {
- // do not allow deleting the storage's root / the mount point
- // because for some storages it might delete the whole contents
- // but isn't supposed to work that way
- return false;
+ if ($mount->getInternalPath($absolutePath) === '') {
+ if ($mount instanceof MoveableMount) {
+ return $mount->removeMount();
+ } else {
+ // do not allow deleting the storage's root / the mount point
+ // because for some storages it might delete the whole contents
+ // but isn't supposed to work that way
+ return false;
+ }
}
return $this->basicOperation('unlink', $path, array('delete'));
}