final class CreateUserCommand (View source)

What a create-user request asks for, typed and independent of the wire format. The controllers build it from their own field names; the service hands it on to the repository with the password in its stored form.

Methods

__construct(string $username, string|null $password, string $fullname = '', string $email = '', string $description = '', bool $active = true, int|null $permissionTemplateId = null, bool $useLdap = false, bool $useRemoteUser = false)

No description

AuthMethod
authMethod()

The sign-in method the account is created with; the service refuses both flags at once.

bool
passwordGiven()

Whether the request carries a password; "0" is a password, an empty string is not.

withPassword(string $password)

The same request with the password replaced by its stored form (hash or LDAP placeholder).

Details

__construct(string $username, string|null $password, string $fullname = '', string $email = '', string $description = '', bool $active = true, int|null $permissionTemplateId = null, bool $useLdap = false, bool $useRemoteUser = false)

No description

Parameters

string $username

The login name; empty is refused by the service

string|null $password

The plain password, or null when none was given

string $fullname
string $email
string $description
bool $active
int|null $permissionTemplateId

A positive template id, or null when none was resolved

bool $useLdap

Whether the account authenticates against LDAP

bool $useRemoteUser

Whether the web server signs the account in

AuthMethod authMethod()

The sign-in method the account is created with; the service refuses both flags at once.

Return Value

AuthMethod

bool passwordGiven()

Whether the request carries a password; "0" is a password, an empty string is not.

Return Value

bool

CreateUserCommand withPassword(string $password)

The same request with the password replaced by its stored form (hash or LDAP placeholder).

Parameters

string $password

Return Value

CreateUserCommand