diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-07-21 16:43:39 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-07-21 16:43:39 +0200 |
commit | 11725efd7e897be9588042e02f5d7a83d20d4d86 (patch) | |
tree | ba797495700aa3fe5760a24d82a6e8ccd8179bfa | |
parent | 5508a95065cc6bf772621d5222bc23115e7c4df2 (diff) | |
download | nextcloud-server-11725efd7e897be9588042e02f5d7a83d20d4d86.tar.gz nextcloud-server-11725efd7e897be9588042e02f5d7a83d20d4d86.zip |
add some hooks for subadmins
-rw-r--r-- | lib/subadmin.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/subadmin.php b/lib/subadmin.php index 04e6143081c..0806f27a6bd 100644 --- a/lib/subadmin.php +++ b/lib/subadmin.php @@ -19,7 +19,8 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ - +OC_Hook::connect('OC_User', 'post_deleteUser', 'OC_SubAdmin', 'post_deleteUser'); +OC_Hook::connect('OC_User', 'post_deleteGroup', 'OC_SubAdmin', 'post_deleteGroup'); /** * This class provides all methods needed for managing groups. * @@ -155,4 +156,26 @@ class OC_SubAdmin{ public static function isGroupAccessible($subadmin, $group){ return self::isSubAdminofGroup($subadmin, $group); } + + /** + * @brief delete all SubAdmins by uid + * @param $parameters + * @return boolean + */ + public static function post_deleteUser($parameters){ + $stmt = OC_DB::prepare('DELETE FROM *PREFIX*group_admin WHERE uid = ?'); + $result = $stmt->execute(array($parameters['uid'])); + return true; + } + + /** + * @brief delete all SubAdmins8 by gid + * @param $parameters + * @return boolean + */ + public static function post_deleteGroup($parameters){ + $stmt = OC_DB::prepare('DELETE FROM *PREFIX*group_admin WHERE gid = ?'); + $result = $stmt->execute(array($parameters['gid'])); + return true; + } } |