summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-09-02 20:01:09 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-09-02 20:01:09 -0400
commit4c065deb55b1c61059c7693c5861a68869758607 (patch)
treebdaf607185425844f044265cf0861d082e19597b /lib/public
parentdc569ea300ac7112aec7ca6f4e2e409ba8fb7382 (diff)
downloadnextcloud-server-4c065deb55b1c61059c7693c5861a68869758607.tar.gz
nextcloud-server-4c065deb55b1c61059c7693c5861a68869758607.zip
Listen to post_deleteGroup hook in Share API
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/share.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index a7a47ee14c6..7b6b78561d4 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -23,6 +23,7 @@ namespace OCP;
\OC_Hook::connect('OC_User', 'post_deleteUser', 'OCP\Share', 'post_deleteUser');
\OC_Hook::connect('OC_User', 'post_addToGroup', 'OCP\Share', 'post_addToGroup');
\OC_Hook::connect('OC_User', 'post_removeFromGroup', 'OCP\Share', 'post_removeFromGroup');
+\OC_Hook::connect('OC_User', 'post_deleteGroup', 'OCP\Share', 'post_deleteGroup');
/**
* This class provides the ability for apps to share their content between users.
@@ -1069,6 +1070,14 @@ class Share {
}
}
+ public static function post_deleteGroup($arguments) {
+ $query = \OC_DB::prepare('SELECT id FROM `*PREFIX*share` WHERE `share_type` = ? AND `share_with` = ?');
+ $result = $query->execute(array(self::SHARE_TYPE_GROUP, $arguments['gid']));
+ while ($item = $result->fetchRow()) {
+ self::delete($item['id']);
+ }
+ }
+
}
/**