diff options
Diffstat (limited to 'lib/private/group.php')
-rw-r--r-- | lib/private/group.php | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lib/private/group.php b/lib/private/group.php index 49f683c411a..d6e6e17f881 100644 --- a/lib/private/group.php +++ b/lib/private/group.php @@ -37,6 +37,7 @@ class OC_Group { /** * @return \OC\Group\Manager + * @deprecated Use \OC::$server->getGroupManager(); */ public static function getManager() { return \OC::$server->getGroupManager(); @@ -44,6 +45,7 @@ class OC_Group { /** * @return \OC\User\Manager + * @deprecated Use \OC::$server->getUserManager() */ private static function getUserManager() { return \OC::$server->getUserManager(); @@ -73,12 +75,10 @@ class OC_Group { * * Tries to create a new group. If the group name already exists, false will * be returned. Basic checking of Group name + * @deprecated Use \OC::$server->getGroupManager()->createGroup() instead */ public static function createGroup($gid) { - OC_Hook::emit("OC_Group", "pre_createGroup", array("run" => true, "gid" => $gid)); - if (self::getManager()->createGroup($gid)) { - OC_Hook::emit("OC_User", "post_createGroup", array("gid" => $gid)); return true; } else { return false; @@ -91,19 +91,12 @@ class OC_Group { * @return bool * * Deletes a group and removes it from the group_user-table + * @deprecated Use \OC::$server->getGroupManager()->delete() instead */ public static function deleteGroup($gid) { - // Prevent users from deleting group admin - if ($gid == "admin") { - return false; - } - - OC_Hook::emit("OC_Group", "pre_deleteGroup", array("run" => true, "gid" => $gid)); - $group = self::getManager()->get($gid); if ($group) { if ($group->delete()) { - OC_Hook::emit("OC_User", "post_deleteGroup", array("gid" => $gid)); return true; } } @@ -117,6 +110,7 @@ class OC_Group { * @return bool * * Checks whether the user is member of a group or not. + * @deprecated Use \OC::$server->getGroupManager->inGroup($user); */ public static function inGroup($uid, $gid) { $group = self::getManager()->get($gid); @@ -134,14 +128,13 @@ class OC_Group { * @return bool * * Adds a user to a group. + * @deprecated Use \OC::$server->getGroupManager->addUser(); */ public static function addToGroup($uid, $gid) { $group = self::getManager()->get($gid); $user = self::getUserManager()->get($uid); if ($group and $user) { - OC_Hook::emit("OC_Group", "pre_addToGroup", array("run" => true, "uid" => $uid, "gid" => $gid)); $group->addUser($user); - OC_Hook::emit("OC_User", "post_addToGroup", array("uid" => $uid, "gid" => $gid)); return true; } else { return false; @@ -176,6 +169,7 @@ class OC_Group { * * This function fetches all groups a user belongs to. It does not check * if the user exists at all. + * @deprecated Use \OC::$server->getGroupManager->getuserGroupIds($user) */ public static function getUserGroups($uid) { $user = self::getUserManager()->get($uid); @@ -209,6 +203,7 @@ class OC_Group { * * @param string $gid * @return bool + * @deprecated Use \OC::$server->getGroupManager->groupExists($gid) */ public static function groupExists($gid) { return self::getManager()->groupExists($gid); @@ -260,6 +255,7 @@ class OC_Group { * @param int $limit * @param int $offset * @return array an array of display names (value) and user ids(key) + * @deprecated Use \OC::$server->getGroupManager->displayNamesInGroup($gid, $search, $limit, $offset) */ public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) { return self::getManager()->displayNamesInGroup($gid, $search, $limit, $offset); |