I'm doing some R & D with PHP and OpenLDAP

I managed to get the php function ldap_add to work and I've been using PHP
to add form-submitted information to a directory.

However I decided to include another objectclass (uidObject) and now it
returns with:
    error - Object class violation
    error number - 65

I can use the ldapadd client and load an ldif file containing exactly the
same info into the directory.

Why won't it work from within PHP????

I've included an excerpt from my code, below.  Thanks in advance for any
help.

Derek



     12         $ds=ldap_connect("localhost");
     13         if ($ds) {
     14             $r=ldap_bind($ds, "cn=admin,dc=bipcontracts,dc=com",
"mypassword");
     15
     16             $rdn =
"o=$username,ou=suppliers,ou=customers,dc=bipcontracts,dc=com";
     17 $version = phpversion();
     18 echo "$version<br>";
     19             $info["userPassword"]="$password";
     20             $info["o"]="$organisation";
     21             $info["uid"]="$username";
     22             $info["objectclass"]="organization";
     23             $info["objectclass"]="uidObject";
     24
     25             $add=ldap_add($ds,$rdn, $info);
     26 $error = ldap_error($ds);
     27 $errno = ldap_errno($ds);
     28 echo "error is $error number $errno";
     29
     30             ldap_close($ds);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to