0) { // we only care about the first dn $userDN = $allValues[0]["dn"]; // generate a bogus password to pass if the user doesn't give us one // this gets around systems that are anonymous search enabled if (empty($passwd)) $passwd = crypt(microtime()); // try to bind as the user with user suplied password if (ldap_bind($ldap,$userDN, $passwd)) return True; } // Turn error reporting back to normal error_reporting(7); // dn not found or password wrong return False; } } ?>