// User Custom Validate event
function User_CustomValidate(&$usr, &$pwd) {
// Enter your custom code to validate user, return TRUE if valid.
// LDAP authentication example for User_CustomValidate server event
if (!function_exists("ldap_connect"))
die("LDAP extension not installed.");
$ldapconn = ldap_connect("server.company.com", 389) or die("Could not connect to LDAP server."); // Note: Replace the host name and port
if ($ldapconn && ldap_bind($ldapconn, $usr, $pwd)) {
$this->setCurrentUserName($usr); // Set the current user name
return TRUE;
}
return FALSE;
}
I have an application that uses this block of code to facilitate LDAP authentication. On the login page, users must put in company\user.name - How can I concatenate the "company\" part to the usr variable in this code?