Skip to content
Snippets Groups Projects
Commit bbfb93c6 authored by Robin Appelman's avatar Robin Appelman
Browse files

remove groups if there are no users in them

parent bfd72501
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,10 @@ if( OC_Group::inGroup( $username, $group )){ ...@@ -28,6 +28,10 @@ if( OC_Group::inGroup( $username, $group )){
$action = "remove"; $action = "remove";
$error = "remove user from"; $error = "remove user from";
$success = OC_Group::removeFromGroup( $username, $group ); $success = OC_Group::removeFromGroup( $username, $group );
$usersInGroup=OC_Group::usersInGroup($group);
if(count($usersInGroup)==0){
OC_Group::deleteGroup($group);
}
} }
else{ else{
$success = OC_Group::addToGroup( $username, $group ); $success = OC_Group::addToGroup( $username, $group );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment