diff options
author | Joas Schilling <coding@schilljs.com> | 2020-02-06 17:09:09 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-02-17 09:04:19 +0100 |
commit | 841f2f3b0491dfec43491911f20cce7a78408a1b (patch) | |
tree | 15e9f59d31aa60b5f6e63af928af5b8e8f16e094 /apps | |
parent | 6895a235174d02fe095cb51321e60e8ffaa3cfcf (diff) | |
download | nextcloud-server-841f2f3b0491dfec43491911f20cce7a78408a1b.tar.gz nextcloud-server-841f2f3b0491dfec43491911f20cce7a78408a1b.zip |
Allow to overwrite share target mountpoints
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/SharedMount.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/SharedMount.php b/apps/files_sharing/lib/SharedMount.php index a1a011a9b7d..91f3c39ba05 100644 --- a/apps/files_sharing/lib/SharedMount.php +++ b/apps/files_sharing/lib/SharedMount.php @@ -33,7 +33,9 @@ use OC\Files\Filesystem; use OC\Files\Mount\MountPoint; use OC\Files\Mount\MoveableMount; use OC\Files\View; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Storage\IStorageFactory; +use OCP\Share\Events\VerifyMountPointEvent; /** * Shared mount points can be moved by the user @@ -91,6 +93,12 @@ class SharedMount extends MountPoint implements MoveableMount { $mountPoint = basename($share->getTarget()); $parent = dirname($share->getTarget()); + $event = new VerifyMountPointEvent($share, $this->recipientView, $parent); + /** @var IEventDispatcher $dispatcher */ + $dispatcher = \OC::$server->query(IEventDispatcher::class); + $dispatcher->dispatchTyped($event); + $parent = $event->getParent(); + if ($folderExistCache->hasKey($parent)) { $parentExists = $folderExistCache->get($parent); } else { |