Adding OU to Open LDAP Server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruno Marinho

    Adding OU to Open LDAP Server

    Hi,

    I'm having a problem creating an OU entry on a Open LDAP Server. I'm using the code below.

    $ad = ldap_connect("l dap://srvldap");
    ldap_set_option ($ad, LDAP_OPT_PROTOC OL_VERSION, 3);
    $bd = ldap_bind($ad," CN=Admin,DC=sub domain,DC=domai n,DC=com","secr et");

    $newou["objectClas s"][0] = "top";
    $newou["objectClas s"][1] = "organizational Unit";
    $newou["ou"] = "myou";

    $sync = ldap_add($ad,"O U=teste,OU=HPA, OU=Utilizadores ,DC=subdomain,D C=domain,DC=com ",$newou);

    Then i'm getting a warning message:

    Warning: ldap_add() [function.ldap-add]: Add: Undefined attribute type in /var/www/project/ou_insert.php on line 85 -Corresponds to ($sync = ldap_add($ad,"O U=teste,OU=HPA, OU=Utilizadores ,DC=subdomain,D C=domain,DC=com ",$ newou));

    Can u tell me what i'm doing wrong?

    Thanks for your help people.

    Regards,

    Bruno Marinho


    --------------= Posted using GrabIt =----------------
    ------= Binary Usenet downloading made easy =---------
    -= Get GrabIt for free from http://www.shemes.com/ =-

  • Bruno Marinho

    #2
    Re: Adding OU to Open LDAP Server

    Sorry guys,

    The warning i'm getting with the supplied code is:

    Warning: ldap_add() [function.ldap-add]: Add: Invalid syntax in
    /var/www/LDAPSync/ou_insert.php on line 87

    Can anyone tell me what is wrong?

    Thanks again,

    Bruno Marinho

    Comment

    Working...