I know how to bind LDAP for authentication that uses search, but what can I do if I want ALL full name entries ... So how can I get the full names or emails of ALL people?
Below I use the LDAP binding 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 that I have that populates the 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 the html list of letters is displayed. What I want to do is the same with LDAP, except for displaying the full name of all ldap users in the directory ... MY LDAP has only 200 people, so it is not too big.
Any ideas?
source share