updates for active directory now with docs, noiw with microsoft AD sync
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user