In the ldap_bind(), I have entered "my" dn to be able to authenticate for now, but with this I am the only person that would be able to login.
I could bind to the server twice, once to get an individuals "dn" , set the variable, and then once I have the "user's" dn I could bind again as that user, but this seems like it would cause a lot of overhead. Does anyone have a better way to do this than bind twice?
$dn = "OU=Anoka-Hennepin,DC=ah,DC=isd11";
$filter = "(samaccountname=" . $username . "*)";
$ad = ldap_connect("ldap://172.22.1.20") or die("Couldn't connect to AD!");
$bd = ldap_bind($ad, "CN=Tuller\, Mike,OU=Staff,OU=LCDC,OU=Anoka-Hennepin,DC=ah,DC=isd11",$password)
or die("Couldn't bind to AD!");
$result = ldap_search($ad, $dn, $filter);
$entries = ldap_get_entries($ad, $result);
for ($i=0; $i<$entries["count"]; $i++) { echo $entries[$i]["dn"]; }
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php