Skip to content

Commit

Permalink
fix: Only list remnants as disabled if option is enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed May 16, 2024
1 parent bd6989d commit 5a154cb
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions apps/user_ldap/lib/User_Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
}
}
}

0 comments on commit 5a154cb

Please sign in to comment.