IProvideEnabledStateBackend.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\User\Backend;
  8. /**
  9. * @since 28.0.0
  10. */
  11. interface IProvideEnabledStateBackend {
  12. /**
  13. * @since 28.0.0
  14. *
  15. * @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
  16. */
  17. public function isUserEnabled(string $uid, callable $queryDatabaseValue): bool;
  18. /**
  19. * @since 28.0.0
  20. *
  21. * @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
  22. * @param callable(bool):void $setDatabaseValue A callable to set the enabled state in the database.
  23. */
  24. public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool;
  25. /**
  26. * Get the list of disabled users, to merge with the ones disabled in database
  27. *
  28. * @since 28.0.0
  29. * @since 30.0.0 $search parameter added
  30. *
  31. * @return string[]
  32. */
  33. public function getDisabledUserList(?int $limit = null, int $offset = 0, string $search = ''): array;
  34. }