make sure the group exists in the backend before adding a user to it
This commit is contained in:
parent
ac8bfc218e
commit
2c99924f7d
|
@ -177,7 +177,11 @@ class OC_Group {
|
|||
if(!$backend->implementsActions(OC_GROUP_BACKEND_ADD_TO_GROUP))
|
||||
continue;
|
||||
|
||||
$succes|=$backend->addToGroup($uid, $gid);
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue