1
0

LookupServerSendCheckBackgroundJob.php 790 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Core\BackgroundJobs;
  8. use OCP\AppFramework\Utility\ITimeFactory;
  9. use OCP\BackgroundJob\QueuedJob;
  10. use OCP\IConfig;
  11. use OCP\IUser;
  12. use OCP\IUserManager;
  13. class LookupServerSendCheckBackgroundJob extends QueuedJob {
  14. public function __construct(
  15. protected IConfig $config,
  16. private IUserManager $userManager,
  17. ITimeFactory $time,
  18. ) {
  19. parent::__construct($time);
  20. }
  21. /**
  22. * @param array $argument
  23. */
  24. public function run($argument): void {
  25. $this->userManager->callForSeenUsers(function (IUser $user) {
  26. $this->config->setUserValue($user->getUID(), 'lookup_server_connector', 'dataSend', '1');
  27. });
  28. }
  29. }