From b86e124e03fa9fa3ddb17bfae0b00c28bc402da1 Mon Sep 17 00:00:00 2001 From: kondou Date: Fri, 22 Aug 2014 16:11:54 +0200 Subject: [PATCH] Warn user on resetting passwords via occ when encryption is enabled --- core/command/user/resetpassword.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/command/user/resetpassword.php b/core/command/user/resetpassword.php index d7893c291e4..10a21960849 100644 --- a/core/command/user/resetpassword.php +++ b/core/command/user/resetpassword.php @@ -48,6 +48,16 @@ class ResetPassword extends Command { if ($input->isInteractive()) { /** @var $dialog \Symfony\Component\Console\Helper\DialogHelper */ $dialog = $this->getHelperSet()->get('dialog'); + + if (\OCP\App::isEnabled('files_encryption')) { + $output->writeln( + 'Warning: Resetting the password when using encryption will result in data loss!' + ); + if (!$dialog->askConfirmation($output, 'Do you want to continue?', true)) { + return 1; + } + } + $password = $dialog->askHiddenResponse( $output, 'Enter a new password: ', -- 2.39.5