ldap object class violation with ldap_add in php4.0.4pl1
| From: | Derek | Date: | Wed, 20 Jun 2001 14:22:45 +0000 |
| Subject: | ldap object class violation with ldap_add in php4.0.4pl1 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-54534@lists.php.net to get a copy of this message | ||
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);