ldap_get_option(LDAP_OPT_SERVER_CONTROLS)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jacques Lebastard

    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_RESU LT_OID_STRING). My understanding is that in case of
    partial results (using a previous ldap_set_option (...,
    LDAP_OPT_SERVER _CONTROLS, array(array("oi d"=>"1.2.840.11 3556.1.4.319",
    "value"=>10 0, "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_resu lts is not documented. Moreover,
    php-4.3.10/ext/ldap/ldap.c currently contains:[color=blue]
    > rc = ldap_parse_resu lt( ld->link, ldap_result, &lerrcode,
    > myargcount > 3 ? &lmatcheddn : NULL,
    > myargcount > 4 ? &lerrmsg : NULL,
    > myargcount > 5 ? &lreferrals : NULL,
    > NULL /* &serverctrls */,
    > 0 );[/color]
    :-(

    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?
Working...