View Issue Details

IDProjectCategoryView StatusLast Update
12692Feature requests[All Projects] User/User groupspublic2017-09-21 11:52
Reporterfunnydj Assigned To 
PrioritynoneSeverityfeature 
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary12692: LDAP import paging
Description

Version: 2.67.3
LDAP server is limited to 1000 results because of ldap_search.
Whit debug =2 quering a group with more than 1000 users will bring to this error "ldap_search(): Partial search results returned: Sizelimit exceeded ". Without debug it will stop at 1000 rows.
The correct way to query a ldap server is to use pagination that is supported from ldap protocol 3.

Is possible to change the ldap_helper.php adding a loop of paged results if protocol == 3?

Something like this (from php.net manual):
// enable pagination with a page size of 100.
$pageSize = 100;

 $cookie = '';
 do {
     ldap_control_paged_result($ds, $pageSize, true, $cookie);

     $result  = ldap_search($ds, $dn, $filter, $justthese);
     $entries = ldap_get_entries($ds, $result);

     foreach ($entries as $e) {
         echo $e['dn'] . PHP_EOL;
     }

     ldap_control_paged_result_response($ds, $result, $cookie);

 } while($cookie !== null && $cookie != '');

// RESET PAGED RESULT OR GET ERRORS!!!
ldap_control_paged_result($connection, 1000, false, $cookie);

TagsNo tags attached.

Activities

funnydj

funnydj

2017-09-21 11:52

reporter  

error1.PNG (40,792 bytes)
error1.PNG (40,792 bytes)

Issue History

Date Modified Username Field Change
2017-09-21 11:52 funnydj New Issue
2017-09-21 11:52 funnydj File Added: error1.PNG