diff options
Diffstat (limited to 'apps/encryption/lib/Command/FixEncryptedVersion.php')
-rw-r--r-- | apps/encryption/lib/Command/FixEncryptedVersion.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/encryption/lib/Command/FixEncryptedVersion.php b/apps/encryption/lib/Command/FixEncryptedVersion.php index e2181f9a229..a85a96258fc 100644 --- a/apps/encryption/lib/Command/FixEncryptedVersion.php +++ b/apps/encryption/lib/Command/FixEncryptedVersion.php @@ -24,6 +24,7 @@ namespace OCA\Encryption\Command; use OC\Files\View; use OC\HintException; +use OCA\Encryption\Util; use OCP\Files\IRootFolder; use OCP\IConfig; use OCP\ILogger; @@ -46,14 +47,25 @@ class FixEncryptedVersion extends Command { /** @var IUserManager */ private $userManager; + /** @var Util */ + private $util; + /** @var View */ private $view; - public function __construct(IConfig $config, ILogger $logger, IRootFolder $rootFolder, IUserManager $userManager, View $view) { + public function __construct( + IConfig $config, + ILogger $logger, + IRootFolder $rootFolder, + IUserManager $userManager, + Util $util, + View $view + ) { $this->config = $config; $this->logger = $logger; $this->rootFolder = $rootFolder; $this->userManager = $userManager; + $this->util = $util; $this->view = $view; parent::__construct(); } @@ -89,6 +101,11 @@ class FixEncryptedVersion extends Command { return 1; } + if (!$this->util->isMasterKeyEnabled()) { + $output->writeln("<error>Repairing only works with master key encryption.</error>\n"); + return 1; + } + $user = (string)$input->getArgument('user'); $pathToWalk = "/$user/files"; |