diff options
Diffstat (limited to 'apps/encryption/lib/Command')
-rw-r--r-- | apps/encryption/lib/Command/DisableMasterKey.php | 6 | ||||
-rw-r--r-- | apps/encryption/lib/Command/EnableMasterKey.php | 6 | ||||
-rw-r--r-- | apps/encryption/lib/Command/RecoverUser.php | 8 |
3 files changed, 4 insertions, 16 deletions
diff --git a/apps/encryption/lib/Command/DisableMasterKey.php b/apps/encryption/lib/Command/DisableMasterKey.php index 18bf0b3903d..d59e3b586c8 100644 --- a/apps/encryption/lib/Command/DisableMasterKey.php +++ b/apps/encryption/lib/Command/DisableMasterKey.php @@ -50,7 +50,6 @@ class DisableMasterKey extends Command { public function __construct(Util $util, IConfig $config, QuestionHelper $questionHelper) { - $this->util = $util; $this->config = $config; $this->questionHelper = $questionHelper; @@ -64,10 +63,9 @@ class DisableMasterKey extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $isMasterKeyEnabled = $this->util->isMasterKeyEnabled(); - if(!$isMasterKeyEnabled) { + if (!$isMasterKeyEnabled) { $output->writeln('Master key already disabled'); } else { $question = new ConfirmationQuestion( @@ -83,7 +81,5 @@ class DisableMasterKey extends Command { $output->writeln('aborted.'); } } - } - } diff --git a/apps/encryption/lib/Command/EnableMasterKey.php b/apps/encryption/lib/Command/EnableMasterKey.php index d1148c88ccd..6c4645e7212 100644 --- a/apps/encryption/lib/Command/EnableMasterKey.php +++ b/apps/encryption/lib/Command/EnableMasterKey.php @@ -49,7 +49,6 @@ class EnableMasterKey extends Command { public function __construct(Util $util, IConfig $config, QuestionHelper $questionHelper) { - $this->util = $util; $this->config = $config; $this->questionHelper = $questionHelper; @@ -63,10 +62,9 @@ class EnableMasterKey extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $isAlreadyEnabled = $this->util->isMasterKeyEnabled(); - if($isAlreadyEnabled) { + if ($isAlreadyEnabled) { $output->writeln('Master key already enabled'); } else { $question = new ConfirmationQuestion( @@ -79,7 +77,5 @@ class EnableMasterKey extends Command { $output->writeln('aborted.'); } } - } - } diff --git a/apps/encryption/lib/Command/RecoverUser.php b/apps/encryption/lib/Command/RecoverUser.php index 9d98b38de47..a4d7b2407d6 100644 --- a/apps/encryption/lib/Command/RecoverUser.php +++ b/apps/encryption/lib/Command/RecoverUser.php @@ -54,7 +54,6 @@ class RecoverUser extends Command { IConfig $config, IUserManager $userManager, QuestionHelper $questionHelper) { - $this->util = $util; $this->questionHelper = $questionHelper; $this->userManager = $userManager; @@ -74,10 +73,9 @@ class RecoverUser extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $isMasterKeyEnabled = $this->util->isMasterKeyEnabled(); - if($isMasterKeyEnabled) { + if ($isMasterKeyEnabled) { $output->writeln('You use the master key, no individual user recovery needed.'); return; } @@ -90,7 +88,7 @@ class RecoverUser extends Command { } $recoveryKeyEnabled = $this->util->isRecoveryEnabledForUser($uid); - if($recoveryKeyEnabled === false) { + if ($recoveryKeyEnabled === false) { $output->writeln('Recovery key is not enabled for: ' . $uid); return; } @@ -108,7 +106,5 @@ class RecoverUser extends Command { $output->write('Start to recover users files... This can take some time...'); $this->userManager->get($uid)->setPassword($newLoginPassword, $recoveryPassword); $output->writeln('Done.'); - } - } |