From 354b1b8e6efa92aac7557b8a536ac20362b91c04 Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 3 Mar 2020 12:12:44 +0300 Subject: [PATCH] fix return --- .../Phrasea/Command/User/UserPasswordCommand.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/User/UserPasswordCommand.php b/lib/Alchemy/Phrasea/Command/User/UserPasswordCommand.php index 9e282966b1..bd87c4d885 100644 --- a/lib/Alchemy/Phrasea/Command/User/UserPasswordCommand.php +++ b/lib/Alchemy/Phrasea/Command/User/UserPasswordCommand.php @@ -123,11 +123,17 @@ class UserPasswordCommand extends Command if (($password || $generate || $getHash) && $oldHash) { if ($jsonformat) { - $hash['password_hash'] = $oldHash; - $hash['nonce'] = $oldNonce; + if ($password) { + $hash['new_password'] = $password; + } + $hash['password_hash'] = $oldHash; + $hash['nonce'] = $oldNonce; echo json_encode($hash); } else { + if ($password) { + $output->writeln('new_password :' . $password); + } $output->writeln('password_hash :' . $oldHash); $output->writeln('nonce :' . $oldNonce); }