From 7aad8b23f01f70ed8f859717c5d76312e532f638 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 13 Jan 2014 10:00:20 +0100 Subject: [PATCH] hide passord on admin creation using CLI --- CHANGELOG.md | 2 +- core/lib/Thelia/Command/CreateAdminUser.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5450a331..c5cf8d36f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ - Coupon effect inputs are now more customisable (input text, select, ajax, etc.. are usable) and unlimited amount of input for coupon effect are now possible too - when a category is deleted, all subcategories are deleted - delete products when categories are removed. Works only when the category is the default one for this product -- Manager update exists now. Run php Thelia thelia:update +- Manager update exists now. Run ```php Thelia thelia:update``` - Coupon works now - Improved tax rule configuration diff --git a/core/lib/Thelia/Command/CreateAdminUser.php b/core/lib/Thelia/Command/CreateAdminUser.php index 988122e7a..026cf42ca 100644 --- a/core/lib/Thelia/Command/CreateAdminUser.php +++ b/core/lib/Thelia/Command/CreateAdminUser.php @@ -88,9 +88,10 @@ class CreateAdminUser extends ContainerAwareCommand )); } - protected function enterData($dialog, $output, $label, $error_message) + protected function enterData($dialog, $output, $label, $error_message, $hidden = false) { - return $dialog->askAndValidate( + $command = $hidden ? 'askHiddenResponse' : 'askAndValidate'; + return $dialog->$command( $output, $this->decorateInfo($label), function ($answer) { @@ -122,8 +123,8 @@ class CreateAdminUser extends ContainerAwareCommand $admin->setLastname($input->getOption("last_name") ?: $this->enterData($dialog, $output, "User last name : ", "Please enter user last name.")); do { - $password = $input->getOption("password") ?: $this->enterData($dialog, $output, "Password : ", "Please enter a password."); - $password_again = $input->getOption("password") ?: $this->enterData($dialog, $output, "Password (again): ", "Please enter the password again."); + $password = $input->getOption("password") ?: $this->enterData($dialog, $output, "Password : ", "Please enter a password.", true); + $password_again = $input->getOption("password") ?: $this->enterData($dialog, $output, "Password (again): ", "Please enter the password again.", true); if (! empty($password) && $password == $password_again) {