src/Native5/Services/Users/DefaultUserManager.php
public function createUser(\Native5\Services\Users\User $user) {
        global $logger;
        $path     = 'users/create';
        $request = $this->_remoteServer->post($path)
            ->setPostField('username', $user->getUsername())
            ->setPostField('password', $user->getPassword())
            ->setPostField('name', $user->getName())
            ->setPostField('roles', json_encode($user->getRoles()))
            ->setPostField('aliases', json_encode($user->getAliases()));
        try {
            $response = $request->send();
        } catch(\Guzzle\Http\Exception\BadResponseException $e) {
            $logger->info($e->getResponse()->getBody('true'), array());
            return false;
        }

        return true; 
    }
public function createUser(\Native5\Services\Users\User $user) {
        global $logger;
        $path     = 'users/create';
        $request = $this->_remoteServer->post($path)
            ->setPostField('username', $user->getUsername())
            ->setPostField('password', $user->getPassword())
            ->setPostField('name', $user->getName())
            ->setPostField('roles', json_encode($user->getRoles()))
            ->setPostField('aliases', json_encode($user->getAliases()));
        try {
            $response = $request->send();
        } catch(\Guzzle\Http\Exception\BadResponseException $e) {
            $logger->info($e->getResponse()->getBody('true'), array());
            return false;
        }

        return true; 
    }
public function createUser ( \ Native5 \ Services \ Users \ User $ user ) { global $ logger ; $ path = 'users/create' ; $ request = $ this -> _remoteServer -> post ( $ path ) -> setPostField ( 'username' , $ user -> getUsername ( ) ) -> setPostField ( 'password' , $ user -> getPassword ( ) ) -> setPostField ( 'name' , $ user -> getName ( ) ) -> setPostField ( 'roles' , json_encode ( $ user -> getRoles ( ) ) ) -> setPostField ( 'aliases' , json_encode ( $ user -> getAliases ( ) ) ) ; try { $ response = $ request -> send ( ) ; } catch ( \ Guzzle \ Http \ Exception \ BadResponseException $ e ) { $ logger -> info ( $ e -> getResponse ( ) -> getBody ( 'true' ) , array ( ) ) ; return false ; } return true ; }
createUser Create User for an application

@param mixed $username   Login username
@param mixed $password   Login password
@param mixed $name       User name
@param array $roles      Optional user roles as an array
@param array $aliases    Optional user aliases as an associative array
@access public
@return boolean          true on success, false otherwise
createUser Create User for an application