diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php index 3df1990359a15..cfc9d7d921f45 100644 --- a/apps/user_ldap/lib/User_Proxy.php +++ b/apps/user_ldap/lib/User_Proxy.php @@ -464,13 +464,18 @@ public function setUserEnabled(string $uid, bool $enabled, callable $queryDataba } public function getDisabledUserList(?int $limit = null, int $offset = 0): array { - return array_map( - fn (OfflineUser $user) => $user->getOCName(), - array_slice( - $this->deletedUsersIndex->getUsers(), - $offset, - $limit - ) - ); + if ((int)$this->getAccess(array_key_first($this->backends) ?? '')->connection->markRemnantsAsDisabled === 1) { + /* If first LDAP configuration considers remnants as disabled we consider all of them do */ + return array_map( + fn (OfflineUser $user) => $user->getOCName(), + array_slice( + $this->deletedUsersIndex->getUsers(), + $offset, + $limit + ) + ); + } else { + return []; + } } }