aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-06-29 16:15:12 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-06-29 16:15:12 +0200
commit189ccc2d722bdfb16a96432f709d18438c80c29e (patch)
tree30c72bb234642501d0b6035aca785988111523ab /apps/user_ldap
parent1603cdc8d2798ddc2799a75deaf42b58515f84cd (diff)
downloadnextcloud-server-189ccc2d722bdfb16a96432f709d18438c80c29e.tar.gz
nextcloud-server-189ccc2d722bdfb16a96432f709d18438c80c29e.zip
Add method to list disabled users to IProvideEnabledStateBackend
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/User_LDAP.php4
-rw-r--r--apps/user_ldap/lib/User_Proxy.php12
2 files changed, 16 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index d4a851bd7aa..f9ae6bbee66 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -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');
+ }
}
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php
index e0f1bb2d522..0449c89bd24 100644
--- a/apps/user_ldap/lib/User_Proxy.php
+++ b/apps/user_ldap/lib/User_Proxy.php
@@ -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
+ )
+ );
+ }
}