UserCommandController
class UserCommandController extends CommandController (View source)
The User Command Controller
Properties
protected UserService | $userService | ||
protected array | $authenticationProviderSettings |
Methods
List all users
Shows the given user
Create a new user
Delete a user (with globbing)
Activate a user (with globbing)
Deactivate a user (with globbing)
Set a new password for the given user
Add a role to a user
Remove a role from a user
Find all users the match the given username with globbing support
Details
void
listCommand()
List all users
This command lists all existing Neos users.
void
showCommand(string $username, string $authenticationProvider = null)
Shows the given user
This command shows some basic details about the given user. If such a user does not exist, this command will exit with a non-zero status code.
The user will be retrieved by looking for a Neos backend account with the given identifier (ie. the username) and then retrieving the user which owns that account. If an authentication provider is specified, this command will look for an account identified by "username" for that specific provider.
void
createCommand(string $username, string $password, string $firstName, string $lastName, string $roles = null, string $authenticationProvider = null)
Create a new user
This command creates a new user which has access to the backend user interface.
More specifically, this command will create a new user and a new account at the same time. The created account is, by default, a Neos backend account using the the "Neos.Neos:Backend" for authentication. The given username will be used as an account identifier for that new account.
If an authentication provider name is specified, the new account will be created for that provider instead.
Roles for the new user can optionally be specified as a comma separated list. For all roles provided by Neos, the role namespace "Neos.Neos:" can be omitted.
void
deleteCommand(string $username, bool $assumeYes = false, string $authenticationProvider = null)
Delete a user (with globbing)
This command deletes an existing Neos user. All content and data directly related to this user, including but not limited to draft workspace contents, will be removed as well.
All accounts owned by the given user will be deleted.
If an authentication provider is specified, this command will look for an account with the given username related to the given provider. Specifying an authentication provider does not mean that only the account for that provider is deleted! If a user was found by the combination of username and authentication provider, all related accounts will be deleted.
void
activateCommand(string $username, string $authenticationProvider = null)
Activate a user (with globbing)
This command reactivates possibly expired accounts for the given user.
If an authentication provider is specified, this command will look for an account with the given username related to the given provider. Still, this command will activate all accounts of a user, once such a user has been found.
void
deactivateCommand(string $username, string $authenticationProvider = null)
Deactivate a user (with globbing)
This command deactivates a user by flagging all of its accounts as expired.
If an authentication provider is specified, this command will look for an account with the given username related to the given provider. Still, this command will deactivate all accounts of a user, once such a user has been found.
void
setPasswordCommand(string $username, string $password, string $authenticationProvider = null)
Set a new password for the given user
This command sets a new password for an existing user. More specifically, all accounts related to the user which are based on a username / password token will receive the new password.
If an authentication provider was specified, the user will be determined by an account identified by "username" related to the given provider.
void
addRoleCommand(string $username, string $role, string $authenticationProvider = null)
Add a role to a user
This command allows for adding a specific role to an existing user.
Roles can optionally be specified as a comma separated list. For all roles provided by Neos, the role namespace "Neos.Neos:" can be omitted.
If an authentication provider was specified, the user will be determined by an account identified by "username" related to the given provider. However, once a user has been found, the new role will be added to all existing accounts related to that user, regardless of its authentication provider.
void
removeRoleCommand(string $username, string $role, string $authenticationProvider = null)
Remove a role from a user
This command allows for removal of a specific role from an existing user.
If an authentication provider was specified, the user will be determined by an account identified by "username" related to the given provider. However, once a user has been found, the role will be removed from all existing accounts related to that user, regardless of its authentication provider.
protected User[]
findUsersByUsernamePattern(string $usernamePattern, string $authenticationProviderName = null)
Find all users the match the given username with globbing support
protected array
getTableRowForUser(User $user)
Prepares a table row for output with data of the given User