Location: PHPKode > projects > Kudos > nirap/includes/ldap_auth.php
<?php 
     $username=$_POST['username'];
     $password=$_POST['password'];
     $filter="(&(|(!(displayname=Administrator))(!(displayname=Admin)))(uid=$username))";        //define an appropriate ldap search filter to find your users, and filter out accounts such as administrator(administrator should be renamed anyway!).
     $dn = "uid=$username, ";
     $ldap=ldap_connect($ldaphost, $ldapport) or die("Could not connect to LDAP");
     $bind=ldap_bind($ldap, "uid=$username,".$baseDN, $password) or die(header('Location: index_invalid.php'));
	 $sr = ldap_search($ldap, $baseDN,"$filter");
     $info = ldap_get_entries($ldap, $sr);
     $fullname=$info[0]["cn"][0];
     $fqdn=$info[0]["dn"];
     setcookie("cookie",$username, time()+1800);
     //setcookie("cookie[fullname]",$fullname);
     //setcookie("cookie[fqdn]", $fqdn);
				
ldap_close($ldap);

?>
Return current item: Kudos