Re: LDAP

From: Date: Wed, 27 Jun 2001 07:26:14 +0000
Subject: Re: LDAP
Groups: php.general 
Request: Send a blank email to php-general+get-55316@lists.php.net to get a copy of this message
Hello, Derek [snip] >However I decided to include another objectclass (uidObject) and now it >returns with: > error - Object class violation > error number - 65 > [snip] > >$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"; > [snip] There is a mistake in your code with the way you are trying to provide multiple values for the objectclass attribute. Your code first assigns "organization" to the objectclass, then replaces this by assigning "uidObject" to the same variable. I think what you need is $info["objectclass"][0]="organization"; $info["objectclass"][1]="uidObject"; This is the way you assign multiple values to an attribute. I suspect that from the error message you were getting your LDAP server was doing schema checking and probably the rules were not allowing an entry that was missing the objectclass "organization". Regards Nick Talbott IT Policy and Strategy Manager, Powys County Council, UK email nickt@powys.gov.uk FAX +44 (0) 1597 824781 web http://www.powys.gov.uk and http://www.powysweb.co.uk

« previous php.general (#55316) next »