summaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-10 22:48:26 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-10 22:48:26 +0200
commitfa102cd229554817d5736e8569e2fc923e9de1e2 (patch)
tree9205d2a8cccf6d09192f91ce86ee7f687f4465c9 /admin
parentf03874ac4994ac54816828a7e5d58570080c5bcf (diff)
downloadnextcloud-server-fa102cd229554817d5736e8569e2fc923e9de1e2.tar.gz
nextcloud-server-fa102cd229554817d5736e8569e2fc923e9de1e2.zip
create the necessary groups when creating a user
Diffstat (limited to 'admin')
-rw-r--r--admin/ajax/createuser.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/admin/ajax/createuser.php b/admin/ajax/createuser.php
index 1bb655ed336..de52f90d4f3 100644
--- a/admin/ajax/createuser.php
+++ b/admin/ajax/createuser.php
@@ -28,6 +28,9 @@ if( in_array( $username, OC_User::getUsers())){
// Return Success story
if( OC_User::createUser( $username, $password )){
foreach( $groups as $i ){
+ if(!OC_Group::groupExists($i)){
+ OC_Group::createGroup($i);
+ }
OC_Group::addToGroup( $username, $i );
}
echo json_encode( array( "status" => "success", "data" => array( "username" => $username, "groups" => implode( ", ", OC_Group::getUserGroups( $username )))));