[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Problem with PHP/LDAP



In data mercoledì 31 ottobre 2001, alle 06:04, Adam Tauno Williams scrive:

> >$ldap_bind = ldap_bind ($ldap_conn, $ldap_manager_dn, $ldap_password);
> >     $info ["objectClass"] = "person";    #ok
> >     $info ["uid"] = "pippo";
> >     $info ["cn"] = "pippo";              #ok
> >     $info ["sn"] = "pippo";              #ok
> >     $info ["objectClass"] = "person";
> >     $info ["objectClass"] = "account";
> >     $info ["objectClass"] = "posixAccount";
> >     $info ["objectClass"] = "top";
> >     $info ["userPassword"] =
> > "{crypt}$1$a0811139$/xUzQIdsvChM1.mhBZx6j/";
> >     $info ["loginShell"] = "/bin/bash";
> >     $info ["uidNumber"] = "505";
> >     $info ["gidNumber"] = "505";
> >     $info ["homeDirectory"] = "/home/pippo";
> >  
> >     $ldap_bind = ldap_add ($ldap_conn, "cn=pippo, dc=example, dc=it",
> > $info);
> >  
> >     ldap_close ($ldap_conn);
> > [...]
> > ------
> > I obtain tha following error message (in /var/log/httpd/error.log):
> > ------
> > LDAP: Object class violation
> >         additional info: attribute not allowed
> > ------
> >Note that if I use only entries tagged with the comment on the right
> >the add is done...
> 
> Because your not adding the objectclass entries except the last one, try:
> 
> $info ["objectClass"][0] = "person";
> $info ["objectClass"][1] = "account";
> $info ["objectClass"][2] = "posixAccount";
> $info ["objectClass"][3] = "top";

It works!!!!
Thank you very much,
tode

-- 
dr. Carlo Todeschini
--
[ senz@rete - Soluzioni Internet/intranet ]
http://www.senzarete.it - mailto:tode@senzarete.it
--
[ Rete Civica di Cremona - System administrator ]
http://www.rccr.cremona.it - mailto:tode@rccr.cremona.it
tel: 0372 25267 - fax: 0372 567701 - via Sesto, 41 - 26100 Cremona
--