make sure the group exists in the backend before adding a user to it

This commit is contained in:
Robin Appelman 2012-05-17 00:47:43 +02:00
parent ac8bfc218e
commit 2c99924f7d
1 changed files with 5 additions and 1 deletions

View File

@ -177,7 +177,11 @@ class OC_Group {
if(!$backend->implementsActions(OC_GROUP_BACKEND_ADD_TO_GROUP))
continue;
if($backend->groupExists($gid)){
$succes|=$backend->addToGroup($uid, $gid);
}
}
if($succes){
OC_Hook::emit( "OC_User", "post_addToGroup", array( "uid" => $uid, "gid" => $gid ));
}
return $succes;