From d420b3f15786ec81fb80b0fd951848ce32205930 Mon Sep 17 00:00:00 2001 From: yemkareems Date: Fri, 14 Nov 2025 16:05:14 +0530 Subject: [PATCH] fix: added the interactive condition to the password question and in non-interactive mode sent the password directly Signed-off-by: yemkareems --- apps/encryption/lib/Crypto/EncryptAll.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/encryption/lib/Crypto/EncryptAll.php b/apps/encryption/lib/Crypto/EncryptAll.php index 3751111d988..2c59a5a8d04 100644 --- a/apps/encryption/lib/Crypto/EncryptAll.php +++ b/apps/encryption/lib/Crypto/EncryptAll.php @@ -278,8 +278,12 @@ class EncryptAll { $this->writePasswordsToFile($newPasswords); $this->output->writeln(''); - $question = new ConfirmationQuestion('Do you want to send the passwords directly to the users by mail? (y/n) ', false); - if ($this->questionHelper->ask($this->input, $this->output, $question)) { + if ($this->input->isInteractive()) { + $question = new ConfirmationQuestion('Do you want to send the passwords directly to the users by mail? (y/n) ', false); + if ($this->questionHelper->ask($this->input, $this->output, $question)) { + $this->sendPasswordsByMail(); + } + } elseif (!$this->input->isInteractive() && $this->input->getOption('no-interaction')) { $this->sendPasswordsByMail(); } }