add some output to explain the pre-conditions for decrypt-all

This commit is contained in:
Bjoern Schiessle 2015-10-05 12:40:01 +02:00
parent f4885f6da3
commit bf82015254
2 changed files with 9 additions and 0 deletions

View File

@ -84,6 +84,9 @@ class DecryptAll {
$recoveryKeyId = $this->keyManager->getRecoveryKeyId(); $recoveryKeyId = $this->keyManager->getRecoveryKeyId();
if (!empty($user)) { if (!empty($user)) {
$output->writeln('You can only decrypt the users files if you know');
$output->writeln('the users password or if he activated the recovery key.');
$output->writeln('');
$questionUseLoginPassword = new ConfirmationQuestion( $questionUseLoginPassword = new ConfirmationQuestion(
'Do you want to use the users login password to decrypt all files? (y/n) ', 'Do you want to use the users login password to decrypt all files? (y/n) ',
false false
@ -98,6 +101,9 @@ class DecryptAll {
$user = $recoveryKeyId; $user = $recoveryKeyId;
} }
} else { } else {
$output->writeln('You can only decrypt the files of all users if the');
$output->writeln('recovery key is enabled by the admin and activated by the users.');
$output->writeln('');
$user = $recoveryKeyId; $user = $recoveryKeyId;
} }

View File

@ -119,6 +119,9 @@ class DecryptAll {
foreach ($encryptionModules as $moduleDesc) { foreach ($encryptionModules as $moduleDesc) {
/** @var IEncryptionModule $module */ /** @var IEncryptionModule $module */
$module = call_user_func($moduleDesc['callback']); $module = call_user_func($moduleDesc['callback']);
$this->output->writeln('');
$this->output->writeln('Prepare "' . $module->getDisplayName() . '"');
$this->output->writeln('');
if ($module->prepareDecryptAll($this->input, $this->output, $user) === false) { if ($module->prepareDecryptAll($this->input, $this->output, $user) === false) {
$this->output->writeln('Module "' . $moduleDesc['displayName'] . '" does not support the functionality to decrypt all files again or the initialization of the module failed!'); $this->output->writeln('Module "' . $moduleDesc['displayName'] . '" does not support the functionality to decrypt all files again or the initialization of the module failed!');
return false; return false;