userManager = $userManager; $this->jobList = $jobList; $this->twofactorManager = $twofactorManager; $this->registry = $registry; } protected function run($argument) { $this->userManager->callForSeenUsers(function (IUser $user) { if (!$user->isEnabled()) { return; } $providers = $this->registry->getProviderStates($user); $isTwoFactorAuthenticated = $this->twofactorManager->isTwoFactorAuthenticated($user); if ($isTwoFactorAuthenticated && isset($providers['backup_codes']) && $providers['backup_codes'] === false) { $this->jobList->add(RememberBackupCodesJob::class, ['uid' => $user->getUID()]); } }); } }