I know how to LDAP bind for authentication which uses search but what can I do if I want ALL of the entries of Full Names...So how can I get the Full names or emails of ALL the people??
Below I use LDAP bind for authentication and I can search for one person but what if I want them all?
<?php
// using ldap bind
$ldaprdn = 'uname'; // ldap rdn or dn
$ldappass = 'password'; // associated password
// connect to ldap server
$ldapconn = ldap_connect("ldap.example.com")
or die("Could not connect to LDAP server.");
if ($ldapconn) {
// binding to ldap server
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
// verify binding
if ($ldapbind) {
echo "LDAP bind successful...";
} else {
echo "LDAP bind failed...";
}
}
?>
This is some MySQL code I have that populates an html list:
<ol>
<?php
mysql_connect("kool", "ohjoa", "sampa") or die(mysql_error());
mysql_select_db("DBtest") or die(mysql_error());
$query = "SELECT * FROM EditOnCall";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<li>".$row['Email']."</li>";
echo "<br />";
}
?>
</ol>
Now this displays a html list of emails. What I want to do is the same thing with LDAP except display the Full Name of all the ldap users in a directory...MY LDAP only has 200 people in it so its not too big.
Any Ideas?