diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-07 09:23:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-07 09:23:47 +0200 |
commit | 0027304b5fc0a92106dca948b72b6fad04b91299 (patch) | |
tree | fb386fc597d4d4c05b885a4ce283db74a71330fd /core/Command/User/ResetPassword.php | |
parent | 74daac49ac4ddfc95b2c90f2784964bf4b8eb2b3 (diff) | |
parent | 59e5ebf330777f39ea9f1e9a12b3a50af1859ed6 (diff) | |
download | nextcloud-server-0027304b5fc0a92106dca948b72b6fad04b91299.tar.gz nextcloud-server-0027304b5fc0a92106dca948b72b6fad04b91299.zip |
Merge pull request #1210 from nextcloud/bump_symfony_console
[3rparty] Bump symfony/console
Diffstat (limited to 'core/Command/User/ResetPassword.php')
-rw-r--r-- | core/Command/User/ResetPassword.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php index ed8cf53b990..cf8c894d7a7 100644 --- a/core/Command/User/ResetPassword.php +++ b/core/Command/User/ResetPassword.php @@ -29,10 +29,13 @@ namespace OC\Core\Command\User; 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\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Question\Question; class ResetPassword extends Command { @@ -79,28 +82,27 @@ class ResetPassword extends Command { return 1; } } elseif ($input->isInteractive()) { - /** @var $dialog \Symfony\Component\Console\Helper\DialogHelper */ - $dialog = $this->getHelperSet()->get('dialog'); + /** @var QuestionHelper $helper */ + $helper = $this->getHelper('question'); if (\OCP\App::isEnabled('encryption')) { $output->writeln( '<error>Warning: Resetting the password when using encryption will result in data loss!</error>' ); - if (!$dialog->askConfirmation($output, '<question>Do you want to continue?</question>', true)) { + + $question = new ConfirmationQuestion('Do you want to continue?'); + if (!$helper->ask($input, $output, $question)) { return 1; } } - $password = $dialog->askHiddenResponse( - $output, - '<question>Enter a new password: </question>', - false - ); - $confirm = $dialog->askHiddenResponse( - $output, - '<question>Confirm the new password: </question>', - false - ); + $question = new Question('Enter a new password: '); + $question->setHidden(true); + $password = $helper->ask($input, $output, $question); + + $question = new Question('Conform the new password: '); + $question->setHidden(true); + $confirm = $helper->ask($input, $output, $question); if ($password !== $confirm) { $output->writeln("<error>Passwords did not match!</error>"); |