updates for active directory now with docs, noiw with microsoft AD sync

This commit is contained in:
Mark Gregory
2026-11-12 12:36:38 +00:00
parent 77b92027df
commit 9404c7a210
18 changed files with 884 additions and 3 deletions
@@ -37,12 +37,20 @@ class ActiveDirectory
$cookie = '';
do {
$result = $ldap->search($baseDn, '(&(objectCategory=person)(objectClass=user))', $attributes, controls: [[
$result = $ldap->search($baseDn, '(&(objectCategory=person)(objectClass=user)(mail=*))', $attributes, controls: [[
'oid' => LDAP_CONTROL_PAGEDRESULTS,
'iscritical' => true,
'value' => ['size' => 500, 'cookie' => $cookie],
]]);
if ($result === false) {
throw new RuntimeException(sprintf(
'Active Directory LDAP paged search failed (LDAP error %s: %s).',
(string) $ldap->errNo(),
ldap_err2str((int) $ldap->errNo())
));
}
try {
$response = $ldap->parseResult($result);
$next = $response ? ($response->controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? null) : null;