]> source.dussan.org Git - nextcloud-server.git/commitdiff
Warn user on resetting passwords via occ when encryption is enabled
authorkondou <kondou@ts.unde.re>
Fri, 22 Aug 2014 14:11:54 +0000 (16:11 +0200)
committerkondou <kondou@ts.unde.re>
Fri, 22 Aug 2014 14:15:04 +0000 (16:15 +0200)
core/command/user/resetpassword.php

index d7893c291e4a1ddb2003beb3e6bfef875fe09a2b..10a21960849aba8f2df8ccb7f7c491c761f08411 100644 (file)
@@ -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(
+                                       '<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)) {
+                                       return 1;
+                               }
+                       }
+
                        $password = $dialog->askHiddenResponse(
                                $output,
                                '<question>Enter a new password: </question>',