summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2014-07-04 17:42:52 +0200
committerBjörn Schießle <schiessle@owncloud.com>2014-07-04 17:42:52 +0200
commita544bd3a0f83a005a4e562bc861e2936578ac1cc (patch)
tree00ff65c5e01b7c13447b267cedd01130d2edc279 /lib
parentd3fab824f7052a8df400890833a0f6743769422c (diff)
parent673b0f5eb93492067a1e8560792d7a3509baa309 (diff)
downloadnextcloud-server-a544bd3a0f83a005a4e562bc861e2936578ac1cc.tar.gz
nextcloud-server-a544bd3a0f83a005a4e562bc861e2936578ac1cc.zip
Merge pull request #9357 from owncloud/sharing_unshare_on_delete
[sharing] unshare childrens on delete
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/view.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 1a9b0e8d2ae..2af693d5a64 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -161,17 +161,27 @@ class View {
return $this->basicOperation('mkdir', $path, array('create', 'write'));
}
+ /**
+ * remove mount point
+ *
+ * @param \OC\Files\Mount\MoveableMount $mount
+ * @param string $path relative to data/
+ * @return boolean
+ */
protected function removeMount($mount, $path){
if ($mount instanceof MoveableMount) {
+ // cut of /user/files to get the relative path to data/user/files
+ $pathParts= explode('/', $path, 4);
+ $relPath = '/' . $pathParts[3];
\OC_Hook::emit(
Filesystem::CLASSNAME, "umount",
- array(Filesystem::signal_param_path => $path)
+ array(Filesystem::signal_param_path => $relPath)
);
$result = $mount->removeMount();
if ($result) {
\OC_Hook::emit(
Filesystem::CLASSNAME, "post_umount",
- array(Filesystem::signal_param_path => $path)
+ array(Filesystem::signal_param_path => $relPath)
);
}
return $result;
@@ -387,7 +397,7 @@ class View {
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
$mount = Filesystem::getMountManager()->find($absolutePath . $postFix);
if ($mount->getInternalPath($absolutePath) === '') {
- return $this->removeMount($mount, $path);
+ return $this->removeMount($mount, $absolutePath);
}
return $this->basicOperation('unlink', $path, array('delete'));
}