I want to retrieve all data from all persons in a ldap server via php program. The ou is ou=people. The ldap server has 500 LIMIT so when i make (cn=*) i get all people who has some cn but i can only get 500 records. I tried to change size limit in my php but the limit is server side (at the moment i can't change that cause i can only query to that server)
<?php
$ldap_conn = ldap_connect($LDAP_Server, $port);
ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
if ($ldap_conn) {
echo "Connection successful ";
$ldap_bind_user = ldap_bind($ldap_conn);
if (!$ldap_bind_user) {
echo "anonymous bind is not successful <br/>";
return;
} else {
echo "anonymous bind successful<br/>";
}
}
// Search users in the group with gid 100
$base = "ou=People,dc=XX,dc=XX";
$filt = "cn=*";
$attributes = array('cn');
$sr = ldap_search($ldap_conn, $base, $filt, $attributes, null, 600, 1000, null);
$info = ldap_get_entries($ldap_conn, $sr);
Any idea to overcome this limit in php. I was thinking on making queries for each letter like, first with A, then B, ... But sometimes maybe the A letter has more than 500. I want to do it in automatic way, maybe someone has achieved that or can suggest a better solution.
Thanks in advance!