From: Robin Appelman Date: Wed, 16 May 2012 22:47:43 +0000 (+0200) Subject: make sure the group exists in the backend before adding a user to it X-Git-Tag: v4.0.0RC2~33 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2c99924f7d2a98c61920de837272d9cff1a33876;p=nextcloud-server.git make sure the group exists in the backend before adding a user to it --- diff --git a/lib/group.php b/lib/group.php index 9b2959d1f73..1e0216a932b 100644 --- a/lib/group.php +++ b/lib/group.php @@ -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;