Currently, I am able to login using the username and password. I wish to be able to login using email address instead of the username. How do you suggest I do it?
Script:
$ldap['username'] = "domain\user123";
$ldap['password'] = "password123";
$ldap['host'] = 'site.domain.com';
$ldap['port'] = 389;
$ldap['dn'] = "CN=Users, DC=domain, DC=com";
$ldap['conn'] = ldap_connect( $ldap['host'], $ldap['port'] )
or die("Could not connect to {$ldap['host']}" );
$ldap['bind'] = ldap_bind($ldap['conn'], $ldap['username'], $ldap['password']);
if( !$ldap['bind'] )
{
echo "Failed";
}
else if( $ldap['bind'] )
{
echo "Success";
}
Any help would be very much appreciated.
Thanks so much!