Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/encryption/lib/Crypto/EncryptAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ protected function outputPasswords(): void {
$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);
$question = new ConfirmationQuestion('Do you want to send the passwords directly to the users by mail? (y/n) ', true);
if ($this->questionHelper->ask($this->input, $this->output, $question)) {
$this->sendPasswordsByMail();
}
Expand Down
10 changes: 8 additions & 2 deletions core/Command/Encryption/EncryptAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

Expand Down Expand Up @@ -58,8 +59,11 @@ protected function configure() {
);
}

/**
* @throws \Exception
*/
protected function execute(InputInterface $input, OutputInterface $output): int {
if (!$input->isInteractive()) {
if (!$input->isInteractive() && !$input->getOption('no-interaction')) {
$output->writeln('Invalid TTY.');
$output->writeln('If you are trying to execute the command in a Docker ');
$output->writeln("container, do not forget to execute 'docker exec' with");
Expand All @@ -83,8 +87,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('Please ensure that no user accesses their files during this time!');
$output->writeln('Note: The encryption module you use determines which files get encrypted.');
$output->writeln('');
$question = new ConfirmationQuestion('Do you really want to continue? (y/n) ', false);
$question = new ConfirmationQuestion('Do you really want to continue? (y/n) ', true);
if ($this->questionHelper->ask($input, $output, $question)) {
//run encryption with the answer yes in interactive mode
$this->forceMaintenanceAndTrashbin();

try {
Expand All @@ -98,6 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->resetMaintenanceAndTrashbin();
return self::SUCCESS;
}
//abort on no in interactive mode
$output->writeln('aborted');
return self::FAILURE;
}
Expand Down
Loading