aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/hooks.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-03-18 15:26:04 +0100
committerRobin Appelman <icewind@owncloud.com>2015-03-26 19:56:57 +0100
commit1be7da4a57ed006bd246f25dbe053b58b89557c9 (patch)
tree377cea7c0ea851f9cf4b16a2194c6df8b1704129 /apps/files_sharing/lib/hooks.php
parent173c31e42af766298c9f43837a9a3e4021cdc131 (diff)
downloadnextcloud-server-1be7da4a57ed006bd246f25dbe053b58b89557c9.tar.gz
nextcloud-server-1be7da4a57ed006bd246f25dbe053b58b89557c9.zip
replace share proxy with hook
Diffstat (limited to 'apps/files_sharing/lib/hooks.php')
-rw-r--r--apps/files_sharing/lib/hooks.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/hooks.php b/apps/files_sharing/lib/hooks.php
index dc7317c5c7d..c3588ecdfe5 100644
--- a/apps/files_sharing/lib/hooks.php
+++ b/apps/files_sharing/lib/hooks.php
@@ -22,6 +22,8 @@
namespace OCA\Files_Sharing;
+use OC\Files\Filesystem;
+
class Hooks {
public static function deleteUser($params) {
@@ -35,4 +37,18 @@ class Hooks {
$manager->removeUserShares($params['uid']);
}
+ public static function unshareChildren($params) {
+ $path = Filesystem::getView()->getAbsolutePath($params['path']);
+ $view = new \OC\Files\View('/');
+
+ // find share mount points within $path and unmount them
+ $mountManager = \OC\Files\Filesystem::getMountManager();
+ $mountedShares = $mountManager->findIn($path);
+ foreach ($mountedShares as $mount) {
+ if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
+ $mountPoint = $mount->getMountPoint();
+ $view->unlink($mountPoint);
+ }
+ }
+ }
}