Logged In: NO

Binding authentication added directly to "Example_Auth"
auth_validatelogin() in local.inc.

// connect...
$ds=ldap_connect($this->ldap_host, $this->ldap_port);// or
echo "Error Connecting to LDAP server...";

if ($ds) {
// admin bind...
$r=ldap_bind($ds, $this->rootdn, $this->rootpw);// or
echo "Error Binding to LDAP server...";
// search for uname...
$sr=ldap_search($ds,$this->basedn, $this-
>attr_uname."=".addslashes($HTTP_POST_VARS["username"]) );
// get matching entries (should only be one)
$info = ldap_get_entries($ds, $sr);

// test all results, and get uid and permissions...
for ($i=0; $i<$info["count"]; $i++) {
// bind as user to test password
$r=@ldap_bind($ds, $info[$i]["dn"],
addslashes($HTTP_POST_VARS["password"]) );
// if bind is successful...
if ($r) {
// fetch UID and perms
$uid = md5($info[$i]["dn"]);
$this->auth["perm"] = $info[$i][$this-

return $uid;