remove groups if there are no users in them
This commit is contained in:
parent
bfd72501a1
commit
bbfb93c655
1 changed files with 4 additions and 0 deletions
|
@ -28,6 +28,10 @@ if( OC_Group::inGroup( $username, $group )){
|
|||
$action = "remove";
|
||||
$error = "remove user from";
|
||||
$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 );
|
||||
|
|
Loading…
Reference in a new issue