diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-05-17 00:47:43 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-05-17 00:47:43 +0200 |
commit | 2c99924f7d2a98c61920de837272d9cff1a33876 (patch) | |
tree | 6817c6fe5cc8928025f7b29d93dec1f128398415 | |
parent | ac8bfc218e3bfe6f6f73b55ce2ce7868c5c9816c (diff) | |
download | nextcloud-server-2c99924f7d2a98c61920de837272d9cff1a33876.tar.gz nextcloud-server-2c99924f7d2a98c61920de837272d9cff1a33876.zip |
make sure the group exists in the backend before adding a user to it
-rw-r--r-- | lib/group.php | 6 |
1 files changed, 5 insertions, 1 deletions
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; |