remove groups if there are no users in them

This commit is contained in:
Robin Appelman 2011-08-11 10:12:03 +02:00
parent bfd72501a1
commit bbfb93c655

View file

@ -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 );