hide passord on admin creation using CLI

This commit is contained in:
Manuel Raynaud
2014-01-13 10:00:20 +01:00
parent a1636e1f50
commit 7aad8b23f0
2 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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) {