summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith H <sharidasan@owncloud.com>2017-03-07 15:39:40 +0530
committerMorris Jobke <hey@morrisjobke.de>2017-03-20 00:01:12 -0600
commita860ee3a45d46a409173c684caf67e296843120c (patch)
tree985dc82845cf852248fe1c48e1a3d3e593d1bdc0
parent528a903a7b23ea628e6ec2fc9a221821297c0bec (diff)
downloadnextcloud-server-a860ee3a45d46a409173c684caf67e296843120c.tar.gz
nextcloud-server-a860ee3a45d46a409173c684caf67e296843120c.zip
Disable empty password for user::resetpassword command using CLI
Fixes issue: https://github.com/owncloud/core/issues/25206 Signed-off-by: Sujith H <sharidasan@owncloud.com> Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r--core/Command/User/ResetPassword.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php
index 3388ef6a1bd..56260e9714a 100644
--- a/core/Command/User/ResetPassword.php
+++ b/core/Command/User/ResetPassword.php
@@ -100,6 +100,11 @@ class ResetPassword extends Command {
$question->setHidden(true);
$password = $helper->ask($input, $output, $question);
+ if ($password === null) {
+ $output->writeln("<error>Password cannot be empty!</error>");
+ return 1;
+ }
+
$question = new Question('Confirm the new password: ');
$question->setHidden(true);
$confirm = $helper->ask($input, $output, $question);