LDAP

From: Date: Fri, 22 Jun 2001 08:21:37 +0000
Subject: LDAP
Groups: php.general 
Request: Send a blank email to php-general+get-54848@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 $ds=ldap_connect("localhost"); if ($ds) { $r=ldap_bind($ds, "cn=admin,dc=domain,dc=com","mypassword"); $rdn = "o=$username,ou=suppliers,ou=customers,dc=domain,dc=com"; $info["userPassword"]="$password"; $info["o"]="$organisation"; $info["uid"]="$username"; $info["objectclass"]="organization"; $info["objectclass"]="uidObject"; $add=ldap_add($ds, $rdn, $info); $error = ldap_error($ds); $errno = ldap_errno($ds); echo "error is $error number $errno"; ldap_close($ds); } else { echo "could not connect to directory<BR>"; }

« previous php.general (#54848) next »