diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-06 20:48:22 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-06 21:20:01 +0200 |
commit | a9c6c351cb5a83196ce3baff3c47f3ba957566ff (patch) | |
tree | 1d9296cda685eedfdf6fb35aa2aa129edcb428e8 /core/Command | |
parent | 1ec5e8a1abfd71b1b587ebba5acdf7d8aaf1d913 (diff) | |
download | nextcloud-server-a9c6c351cb5a83196ce3baff3c47f3ba957566ff.tar.gz nextcloud-server-a9c6c351cb5a83196ce3baff3c47f3ba957566ff.zip |
Move to question helper
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/User/Add.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/core/Command/User/Add.php b/core/Command/User/Add.php index a0ca3315154..368f06cba85 100644 --- a/core/Command/User/Add.php +++ b/core/Command/User/Add.php @@ -28,6 +28,7 @@ use OCP\IGroupManager; use OCP\IUser; use OCP\IUserManager; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -94,18 +95,16 @@ class Add extends Command { return 1; } } elseif ($input->isInteractive()) { - /** @var $dialog \Symfony\Component\Console\Helper\DialogHelper */ - $dialog = $this->getHelperSet()->get('dialog'); - $password = $dialog->askHiddenResponse( - $output, - '<question>Enter password: </question>', - false - ); - $confirm = $dialog->askHiddenResponse( - $output, - '<question>Confirm password: </question>', - false - ); + /** @var QuestionHelper $helper */ + $helper = $this->getHelper('question'); + + $question = new Question('Enter password: '); + $question->setHidden(true); + $password = $helper->ask($input, $output, $question); + + $question = new Question('Confirm password: '); + $question->setHidden(true); + $confirm = $helper->ask($input, $output,$question); if ($password !== $confirm) { $output->writeln("<error>Passwords did not match!</error>"); |