2022-10-05 17:13:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
/**
|
2024-05-23 09:26:56 +02:00
|
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2022-10-05 17:13:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCP\User\Backend;
|
|
|
|
|
|
|
|
/**
|
2023-06-20 15:10:39 +02:00
|
|
|
* @since 28.0.0
|
2022-10-05 17:13:33 +02:00
|
|
|
*/
|
|
|
|
interface IProvideEnabledStateBackend {
|
|
|
|
/**
|
2023-06-20 15:10:39 +02:00
|
|
|
* @since 28.0.0
|
2022-10-05 17:13:33 +02:00
|
|
|
*
|
|
|
|
* @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
|
|
|
|
*/
|
|
|
|
public function isUserEnabled(string $uid, callable $queryDatabaseValue): bool;
|
|
|
|
|
|
|
|
/**
|
2023-06-20 15:10:39 +02:00
|
|
|
* @since 28.0.0
|
2022-10-05 17:13:33 +02:00
|
|
|
*
|
|
|
|
* @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
|
|
|
|
* @param callable(bool):void $setDatabaseValue A callable to set the enabled state in the database.
|
|
|
|
*/
|
2023-06-20 15:10:39 +02:00
|
|
|
public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool;
|
2023-06-29 16:15:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the list of disabled users, to merge with the ones disabled in database
|
|
|
|
*
|
|
|
|
* @since 28.0.0
|
2024-05-16 16:13:31 +02:00
|
|
|
* @since 30.0.0 $search parameter added
|
2023-06-29 16:15:12 +02:00
|
|
|
*
|
|
|
|
* @return string[]
|
|
|
|
*/
|
2024-05-16 16:13:31 +02:00
|
|
|
public function getDisabledUserList(?int $limit = null, int $offset = 0, string $search = ''): array;
|
2022-10-05 17:13:33 +02:00
|
|
|
}
|