mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
If user password set command is run in non-interactive mode, show a warning message if no password is inputted
Related to issue #748
This commit is contained in:
parent
b42d98e9f8
commit
484ba5ebd7
1 changed files with 13 additions and 0 deletions
|
@ -83,6 +83,19 @@ class SetPasswordCommand extends Command
|
||||||
|
|
||||||
while (!$success) {
|
while (!$success) {
|
||||||
$pw1 = $io->askHidden('Please enter new password:');
|
$pw1 = $io->askHidden('Please enter new password:');
|
||||||
|
|
||||||
|
if ($pw1 === null) {
|
||||||
|
$io->error('No password entered! Please try again.');
|
||||||
|
|
||||||
|
//If we are in non-interactive mode, we can not ask again
|
||||||
|
if (!$input->isInteractive()) {
|
||||||
|
$io->warning('Non-interactive mode detected. No password can be entered that way! If you are using docker exec, please use -it flag.');
|
||||||
|
return Command::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$pw2 = $io->askHidden('Please confirm:');
|
$pw2 = $io->askHidden('Please confirm:');
|
||||||
if ($pw1 !== $pw2) {
|
if ($pw1 !== $pw2) {
|
||||||
$io->error('The entered password did not match! Please try again.');
|
$io->error('The entered password did not match! Please try again.');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue