From f84b7907ab247985d71efe36fd5a0fffc713400b Mon Sep 17 00:00:00 2001 From: michag86 Date: Tue, 18 Aug 2015 20:18:13 +0200 Subject: [PATCH] do not remove group if it is empty Sometimes an admin removes a user from a group but he needs the group. This is a big problem if a subadmin removes the last user of a group. He cannot recreate the group --- settings/ajax/togglegroups.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/settings/ajax/togglegroups.php b/settings/ajax/togglegroups.php index 87b60e485b..4d248408db 100644 --- a/settings/ajax/togglegroups.php +++ b/settings/ajax/togglegroups.php @@ -60,9 +60,6 @@ if( OC_Group::inGroup( $username, $group )) { $error = $l->t("Unable to remove user from group %s", $group); $success = OC_Group::removeFromGroup( $username, $group ); $usersInGroup=OC_Group::usersInGroup($group); - if(count($usersInGroup) === 0) { - OC_Group::deleteGroup($group); - } } else{ $success = OC_Group::addToGroup( $username, $group );