mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Add method to list disabled users to IProvideEnabledStateBackend
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
1603cdc8d2
commit
189ccc2d72
3 changed files with 25 additions and 0 deletions
|
|
@ -681,4 +681,8 @@ class User_LDAP extends BackendUtility implements IUserBackend, UserInterface, I
|
|||
$setDatabaseValue($enabled);
|
||||
return $enabled;
|
||||
}
|
||||
|
||||
public function getDisabledUserList(int $offset = 0, ?int $limit = null): array {
|
||||
throw new \Exception('This is implemented directly in User_Proxy');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
namespace OCA\User_LDAP;
|
||||
|
||||
use OCA\User_LDAP\User\DeletedUsersIndex;
|
||||
use OCA\User_LDAP\User\OfflineUser;
|
||||
use OCA\User_LDAP\User\User;
|
||||
use OCP\IConfig;
|
||||
use OCP\IUserBackend;
|
||||
|
|
@ -461,4 +462,15 @@ class User_Proxy extends Proxy implements IUserBackend, UserInterface, IUserLDAP
|
|||
public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool {
|
||||
return $this->handleRequest($uid, 'setUserEnabled', [$uid, $enabled, $queryDatabaseValue, $setDatabaseValue]);
|
||||
}
|
||||
|
||||
public function getDisabledUserList(int $offset = 0, ?int $limit = null): array {
|
||||
return array_map(
|
||||
fn (OfflineUser $user) => $user->getOCName(),
|
||||
array_slice(
|
||||
$this->deletedUsersIndex->getUsers(),
|
||||
$offset,
|
||||
$limit
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,4 +44,13 @@ interface IProvideEnabledStateBackend {
|
|||
* @param callable(bool):void $setDatabaseValue A callable to set the enabled state in the database.
|
||||
*/
|
||||
public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool;
|
||||
|
||||
/**
|
||||
* Get the list of disabled users, to merge with the ones disabled in database
|
||||
*
|
||||
* @since 28.0.0
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getDisabledUserList(int $offset = 0, ?int $limit = null): array;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue