123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace OC\Repair\NC21;
- use OC\Core\BackgroundJobs\CheckForUserCertificates;
- use OCP\BackgroundJob\IJobList;
- use OCP\IConfig;
- use OCP\Migration\IOutput;
- use OCP\Migration\IRepairStep;
- class AddCheckForUserCertificatesJob implements IRepairStep {
-
- protected $jobList;
-
- private $config;
- public function __construct(IConfig $config, IJobList $jobList) {
- $this->jobList = $jobList;
- $this->config = $config;
- }
- public function getName() {
- return 'Queue a one-time job to check for user uploaded certificates';
- }
- private function shouldRun() {
- $versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
-
- return version_compare($versionFromBeforeUpdate, '21.0.0.2', '<');
- }
- public function run(IOutput $output) {
- if ($this->shouldRun()) {
- $this->config->setAppValue('files_external', 'user_certificate_scan', 'not-run-yet');
- $this->jobList->add(CheckForUserCertificates::class);
- }
- }
- }
|