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

LDAP - PHP



With the following ldapsearch command i have good result
ldapsearch -x -H 'ldap://localhost/' -b 'ou=company, dc=domain, dc=com' -D 'uid=100000, ou=company, dc=domain, dc=com' -W cn=*DUPONT*


I would like to do the same thing with PHP

$server = "ldap://localhost"; ;
$ds=ldap_connect($server);
$dn = "uid=100000, ou=company, dc=domain, dc=com";
$value = "password";

$result=@ldap_bind($ds,$dn,$value);
$dn = "ou=company, dc=domain, dc=com";
$filtre = "(cn=*DUPONT*)";
$sr = ldap_search($ds, $dn, $filtre);
$info = ldap_get_entries($ds, $sr);


for ($i=0; $i < $info["count"]; $i++) { print "UID: ".$info[$i]["urn"][0]."<br /><br />"; print "telephoneNumber: ".$info[$i]["telephoneNumber"][0]."<br />"; print "cn: ".$info[$i]["cn"][0]."<br />"; }

 ldap_close($ds);

When i execute this script, i only have URN and cn Informations , i haven't telephoneNumber ?

Thanks for your help