473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ldap_get_option(LDAP_OPT_SERVER_CONTROLS)


I'm trying to perform an ldap_search in order to *always* get the whole
list of objects matching the filter I provide, whatever the PageSize
defined in the directory.

Reading through the LDAP documentation, I understand that I should use
LDAP server controls (with "1.2.840.113556.1.4.319" OID
-LDAP_PAGED_RESULT_OID_STRING). My understanding is that in case of
partial results (using a previous ldap_set_option(...,
LDAP_OPT_SERVER_CONTROLS, array(array("oid"=>"1.2.840.113556.1.4.319",
"value"=>100, "iscritical" => FALSE))) I should analyse, upon a
successful ldap_search, the returned server controls to know whether
there are remaining objects matching the provided filter. It seems that
if the ServerControls should include a ""cookie"" that I should use for
the next ldap_search() to get the "next" 100 matching objects.

Unfortunately PHP ldap_parse_results is not documented. Moreover,
php-4.3.10/ext/ldap/ldap.c currently contains:
rc = ldap_parse_result( ld->link, ldap_result, &lerrcode,
myargcount > 3 ? &lmatcheddn : NULL,
myargcount > 4 ? &lerrmsg : NULL,
myargcount > 5 ? &lreferrals : NULL,
NULL /* &serverctrls */,
0 );

:-(

Is it possible using PHP Ldap extension (the web is Apache/1.3.34
(Win32) PHP/4.3.10 mod_ssl/2.8.25 OpenSSL/0.9.7g, with PHP Ldap built
using OpenLdap 2.2.26) to get all matching results whatever the PageSize
of the directory?
PS: I'm currently using an Active Directory. Does the answer to the
above question depends on the searched directory?
Feb 22 '06 #1
0 1497

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.