Skip to content
Snippets Groups Projects
Commit 11725efd authored by Georg Ehrke's avatar Georg Ehrke
Browse files

add some hooks for subadmins

parent 5508a950
Branches
No related tags found
No related merge requests found
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * 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. * This class provides all methods needed for managing groups.
* *
...@@ -155,4 +156,26 @@ class OC_SubAdmin{ ...@@ -155,4 +156,26 @@ class OC_SubAdmin{
public static function isGroupAccessible($subadmin, $group){ public static function isGroupAccessible($subadmin, $group){
return self::isSubAdminofGroup($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;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment