ldap_set_option

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dirk Laurenz

    #1

    ldap_set_option

    Hi,

    i want to extend somescripts for getting data from an ldap server.
    i want to setup server side sorting with ldap_set_option , but i don't
    know how to correctly define how to sort for example using any attribute.

    i tried this code:

    $arr1 = array("oid" ="1.2.840.11355 6.1.4.473", "iscritical " =false,
    value" ="uid");
    ldap_set_option ($ld, LDAP_OPT_SERVER _CONTROLS, array($arr1));

    The ldap server accepts it and supports serverside sorting. But i get a
    ldap error.

    what works, (code i found)

    $arr1 = array("oid" ="1.2.840.11355 6.1.4.473", "iscritical " =false,
    value" ="\x30\x84\x00\ x00\x00\x0a\x30 \x84\x00\x00\x0 0\x04\x04\x02cn ");
    ldap_set_option ($ld, LDAP_OPT_SERVER _CONTROLS, array($arr1));

    this works fine (for attr "cn")

    trying "\x30\x84\x00\x 00\x00\x0a\x30\ x84\x00\x00\x00 \x04\x04\x02uid "
    doesn't work.

    what am i doing wrong?

    Dirk
Working...