From 75663582aaa15de8c0c400231dcbc907bc2e3172 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Thu, 26 Dec 2013 15:12:54 +0300 Subject: [PATCH 1/2] Hide user password in CLI if possible --- Command/ChangePasswordCommand.php | 3 ++- Command/CreateUserCommand.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Command/ChangePasswordCommand.php b/Command/ChangePasswordCommand.php index 130a01e6f4..a8b873f858 100644 --- a/Command/ChangePasswordCommand.php +++ b/Command/ChangePasswordCommand.php @@ -83,7 +83,8 @@ function($username) { } if (!$input->getArgument('password')) { - $password = $this->getHelper('dialog')->askAndValidate( + $asking_method = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate'; + $password = $this->getHelper('dialog')->$asking_method( $output, 'Please enter the new password:', function($password) { diff --git a/Command/CreateUserCommand.php b/Command/CreateUserCommand.php index 16814f0f0f..243358e66d 100644 --- a/Command/CreateUserCommand.php +++ b/Command/CreateUserCommand.php @@ -115,7 +115,8 @@ function($email) { } if (!$input->getArgument('password')) { - $password = $this->getHelper('dialog')->askAndValidate( + $asking_method = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate'; + $password = $this->getHelper('dialog')->$asking_method( $output, 'Please choose a password:', function($password) { From a4aec6cdef90c9f8156e82e571a3a78418918c0d Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Thu, 26 Dec 2013 15:57:58 +0300 Subject: [PATCH 2/2] change variable of previous commit in camelCase --- Command/ChangePasswordCommand.php | 4 ++-- Command/CreateUserCommand.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Command/ChangePasswordCommand.php b/Command/ChangePasswordCommand.php index a8b873f858..6cb84d785c 100644 --- a/Command/ChangePasswordCommand.php +++ b/Command/ChangePasswordCommand.php @@ -83,8 +83,8 @@ function($username) { } if (!$input->getArgument('password')) { - $asking_method = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate'; - $password = $this->getHelper('dialog')->$asking_method( + $askingMethod = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate'; + $password = $this->getHelper('dialog')->$askingMethod( $output, 'Please enter the new password:', function($password) { diff --git a/Command/CreateUserCommand.php b/Command/CreateUserCommand.php index 243358e66d..01492a3508 100644 --- a/Command/CreateUserCommand.php +++ b/Command/CreateUserCommand.php @@ -115,8 +115,8 @@ function($email) { } if (!$input->getArgument('password')) { - $asking_method = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate'; - $password = $this->getHelper('dialog')->$asking_method( + $askingMethod = method_exists($this->getHelper('dialog'), 'askHiddenResponseAndValidate') ? 'askHiddenResponseAndValidate' : 'askAndValidate'; + $password = $this->getHelper('dialog')->$askingMethod( $output, 'Please choose a password:', function($password) {