use OC\Files\View;
use OC\HintException;
use OCP\Files\IRootFolder;
+use OCP\IConfig;
use OCP\IUserManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
class FixEncryptedVersion extends Command {
+ /** @var IConfig */
+ private $config;
+
/** @var IRootFolder */
private $rootFolder;
/** @var View */
private $view;
- public function __construct(IRootFolder $rootFolder, IUserManager $userManager, View $view) {
+ public function __construct(IConfig $config, IRootFolder $rootFolder, IUserManager $userManager, View $view) {
+ $this->config = $config;
$this->rootFolder = $rootFolder;
$this->userManager = $userManager;
$this->view = $view;
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output) {
+ $skipSignatureCheck = $this->config->getSystemValue('encryption_skip_signature_check', false);
+
+ if ($skipSignatureCheck) {
+ $output->writeln("<error>Repairing is not possible when \"encryption_skip_signature_check\" is set. Please disable this flag in the configuration.</error>\n");
+ return 1;
+ }
+
$user = $input->getArgument('user');
$pathToWalk = "/$user/files";