create the necessary groups when creating a user

This commit is contained in:
Robin Appelman 2011-08-10 22:48:26 +02:00
parent f03874ac49
commit fa102cd229
1 changed files with 3 additions and 0 deletions

View File

@ -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 )))));