> Reply To This Message At:
> http://www.phpbuilder.com/forum/read.php3?num=2&id=24754&thread=24603
>
> hi tony,
> this is the problem: I have to add an entry with many diferent
> objectclass. If i try to enter all in once i have an objectclass
> violation. But if i open a new connection for each objectclass its ok.
> Here is the code: first i add all the objectclass
>
> $r=ldap_bind($ds,"cn=cn", "password");
> $info["objectclass"]="top";
> $info["objectclass"]="person";
> $info["objectclass"]="organizationalperson";
> $info["objectclass"]="inetorgperson";
> $info["objectclass"]="nslicenseuser";
> $info["objectclass"]="mailrecipient";
> $r=ldap_add($ds, "uid=$userid, here is de dn",$info);
>
> then i have to add the value for each one but first i have to
> reconnect or it return an objectclass violation.
>
> $info["objectclass"]="person";
> $info["cn"]="esta es una prueba";
> $info["sn"]="Sixto Diaz";
> $info["userpassword"]="password";
> $info["telephonenumber"]="1236541210";
> $info["mail"]="sixtillo2@sion.com";
> $r=ldap_mod_add($ds, "uid=$userid, here is de dn",$info);
>
> if i try to add another value without open a new connection it returns
> an error.
>
> $info["objectclass"]="mailrecipient";
> $info["mailhost"]="sun.sion.com";
> $info["maildeliveryoption"]="mailbox";
> $info["objectclass"]="nsmessagingserveruser";
> $info["nsmsgdisallowaccess"]="";
> $r=ldap_mod_add($ds, "uid=$userid, here is the dn",$info);
>
> i think that i'm making a mistake. because if i have to add 1 entries,
> i have to bind 5 times to my LDAP server, Perhaps this is ok but i
> don't know.
>
> Please let me know if i this is ok or not.
>
> Regards
> Sixto
>
> ----------------------------------------------------------------------
> -- Ask A New Question At:
> http://www.phpbuilder.com/forum/list.php3?num=2
----------------------------------------------------------------
Antonin Ch. Novak mailto:Antonin.Novak@cca.cz
Systemovy administrator
Systemova a technicka podpora
CCA spol. s r.o. Web: http://www.cca.cz
Kratka 8,
301 17 Plzen
Czech Republic
Tel: +42 019 7221253
Fax: +42 019 7222931