remove groups if there are no users in them
This commit is contained in:
parent
bfd72501a1
commit
bbfb93c655
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue