|
@@ -36,23 +36,12 @@ class AppUserCreateCommand extends Command
|
|
|
{
|
|
|
$io = new SymfonyStyle($input, $output);
|
|
|
|
|
|
- $helper = $this->getHelper('question');
|
|
|
- $questionUsername = new Question('Nom (username) de l\'utilisateur : ', 'admin_user');
|
|
|
- $questionPrenom = new Question('Prénom de l\'utilisateur : ');
|
|
|
- $questionNom = new Question('Nom de l\'utilisateur : ');
|
|
|
- $questionPassword = new Question('Mot de passe :', 'MotDePasse');
|
|
|
- $questionPassword->setHidden(true);
|
|
|
- $questionPassword->setHiddenFallback(false);
|
|
|
- $questionMail = new Question('Email :', 'bidule@truc.chose');
|
|
|
- $questionRole = new ChoiceQuestion('Roles :', array('ROLE_SUPER_ADMIN', 'ROLE_ADMIN', 'ROLE_USER', 'ROLE_MODERATEUR'), '0');
|
|
|
- $questionRole->setMultiselect(true);
|
|
|
-
|
|
|
- $username = $helper->ask($input, $output, $questionUsername);
|
|
|
- $prenom = $helper->ask($input, $output, $questionPrenom);
|
|
|
- $nom = $helper->ask($input, $output, $questionNom);
|
|
|
- $mail = $helper->ask($input, $output, $questionMail);
|
|
|
- $password = $helper->ask($input, $output, $questionPassword);
|
|
|
- $roles = $helper->ask($input, $output, $questionRole);
|
|
|
+ $username = $io->askQuestion(new Question('Nom (username) de l\'utilisateur '));
|
|
|
+ $prenom = $io->askQuestion(new Question('Prénom de l\'utilisateur '));
|
|
|
+ $nom = $io->askQuestion(new Question('Nom de l\'utilisateur '));
|
|
|
+ $mail = $io->askQuestion(new Question('Email ', 'bidule@truc.chose'));
|
|
|
+ $password = $io->askHidden("Mot de passe");
|
|
|
+ $roles = $io->askQuestion((new ChoiceQuestion('Roles ', array('ROLE_SUPER_ADMIN', 'ROLE_ADMIN', 'ROLE_USER', 'ROLE_MODERATEUR'), '0'))->setMultiselect(true));
|
|
|
|
|
|
$this->userManager->createUser(
|
|
|
"$username",
|