src/Sulu/Bundle/SecurityBundle/Controller/UserController.php
public function postAction(Request $request)
    {
        try {
            $this->checkArguments($request);
            $locale = $this->getRequestParameter($request, 'locale', true);
            $data = $request->request->all();
            $data['contactId'] = $request->query->get('contactId');
            $user = $this->getUserManager()->save($data, $locale);
            $view = $this->view($user, 200);
        } catch (UsernameNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (MissingPasswordException $exc) {
            $view = $this->view($exc->toArray(), 400);
        } catch (EmailNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (RestException $re) {
            $view = $this->view($re->toArray(), 400);
        }

        $this->addSerializationGroups($view);

        return $this->handleView($view);
    }
public function postAction(Request $request)
    {
        try {
            $this->checkArguments($request);
            $locale = $this->getRequestParameter($request, 'locale', true);
            $data = $request->request->all();
            $data['contactId'] = $request->query->get('contactId');
            $user = $this->getUserManager()->save($data, $locale);
            $view = $this->view($user, 200);
        } catch (UsernameNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (MissingPasswordException $exc) {
            $view = $this->view($exc->toArray(), 400);
        } catch (EmailNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (RestException $re) {
            $view = $this->view($re->toArray(), 400);
        }

        $this->addSerializationGroups($view);

        return $this->handleView($view);
    }
public function postAction ( Request $ request ) { try { $ this -> checkArguments ( $ request ) ; $ locale = $ this -> getRequestParameter ( $ request , 'locale' , true ) ; $ data = $ request -> request -> all ( ) ; $ data [ 'contactId' ] = $ request -> query -> get ( 'contactId' ) ; $ user = $ this -> getUserManager ( ) -> save ( $ data , $ locale ) ; $ view = $ this -> view ( $ user , 200 ) ; } catch ( UsernameNotUniqueException $ exc ) { $ view = $ this -> view ( $ exc -> toArray ( ) , 409 ) ; } catch ( MissingPasswordException $ exc ) { $ view = $ this -> view ( $ exc -> toArray ( ) , 400 ) ; } catch ( EmailNotUniqueException $ exc ) { $ view = $ this -> view ( $ exc -> toArray ( ) , 409 ) ; } catch ( RestException $ re ) { $ view = $ this -> view ( $ re -> toArray ( ) , 400 ) ; } $ this -> addSerializationGroups ( $ view ) ; return $ this -> handleView ( $ view ) ; }
Creates a new user in the system.

@param \Symfony\Component\HttpFoundation\Request $request

@return \Symfony\Component\HttpFoundation\Response
Creates a new user in the system .