public function replaceUser($username, $passwd = null, $active = null, $extra = null)
    {
        $userDocument         = new User();
        $userDocument->passwd = $passwd;
        $userDocument->active = $active;
        $userDocument->extra  = $extra;
        $data                 = $userDocument->getAll();
        $url                  = UrlHelper::buildUrl(Urls::URL_USER, [$username]);
        $this->getConnection()->put($url, $this->json_encode_wrapper($data));

        return true;
    }
public function replaceUser($username, $passwd = null, $active = null, $extra = null)
    {
        $userDocument         = new User();
        $userDocument->passwd = $passwd;
        $userDocument->active = $active;
        $userDocument->extra  = $extra;
        $data                 = $userDocument->getAll();
        $url                  = UrlHelper::buildUrl(Urls::URL_USER, [$username]);
        $this->getConnection()->put($url, $this->json_encode_wrapper($data));

        return true;
    }
public function replaceUser ( $ username , $ passwd = null , $ active = null , $ extra = null ) { $ userDocument = new User ( ) ; $ userDocument -> passwd = $ passwd ; $ userDocument -> active = $ active ; $ userDocument -> extra = $ extra ; $ data = $ userDocument -> getAll ( ) ; $ url = UrlHelper :: buildUrl ( Urls :: URL_USER , [ $ username ] ) ; $ this -> getConnection ( ) -> put ( $ url , $ this -> json_encode_wrapper ( $ data ) ) ; return true ; }
Replace an existing user, identified by its username

This will replace the user-document on the server

This will throw if the document cannot be replaced

@throws Exception

@param string $username - The name of the user as a string, who's user-data is going to be replaced. This is mandatory.
@param mixed  $passwd   - The user password as a string. If no password is specified, the empty string will be used.
@param mixed  $active   - an optional flag that specifies whether the user is active. If not specified, this will default to true.
@param array  $extra    - an optional array with arbitrary extra data about the user.

@return bool - always true, will throw if there is an error
Replace an existing user identified by its username