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

Re: [Coding Help] RE: HELP---LDAP!!!!!!!! [2:24603:24754]



Sixto

I am still not using PHP to create records in my LDAP database. That is my next step.

When I create my records using the ldapadd command, I can input numerous objectclasses at once by connecting them with a &

eg: objectclass: top & person & organisationalperson & inetorgperson & nslicenseuser & mailrecipient

I don't know if you have tried to create the record like this.

Also you say you have to bind 5 times but you have 6 objectclasses. the last 3 objectclasses are not standard and will have required adding to slapd.oc.conf or the file where they are specified to be loaded in your slapd.conf file like the slapd.oc.conf file

You could also try mailing the
openldap-software@OpenLDAP.org mailing list. There may be someone who has used PHP to add data.

Sorry I can't be of more help.


Tony

> 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