/** * Create a new user * * @param string $username The user name (ie. account identifier) of the new user * @param array $password Expects an array in the format array('<password>', '<password confirmation>') * @param User $user The user to create * @param array $roleIdentifiers A list of roles (role identifiers) to assign to the new user * @Flow\Validate(argumentName="username", type="\TYPO3\Flow\Validation\Validator\NotEmptyValidator") * @Flow\Validate(argumentName="username", type="\TYPO3\Neos\Validation\Validator\UserDoesNotExistValidator") * @Flow\Validate(argumentName="password", type="\TYPO3\Neos\Validation\Validator\PasswordValidator", options={ "allowEmpty"=0, "minimum"=1, "maximum"=255 }) * @return void */ public function createAction($username, array $password, User $user, array $roleIdentifiers) { $this->userService->addUser($username, $password[0], $user, $roleIdentifiers); $this->addFlashMessage('The user "%s" has been created.', 'User created', Message::SEVERITY_OK, array(htmlspecialchars($username)), 1416225561); $this->redirect('index'); }