Skip to content
Snippets Groups Projects
Commit fbfe9427 authored by Imran Hussain's avatar Imran Hussain
Browse files

Update to fix email detectin becuase "very.unusual.@.unusual.com"@example.com...

Update to fix email detectin becuase "very.unusual.@.unusual.com"@example.com is apprently a vlaid email wtf

parent 9b32b369
No related branches found
No related tags found
No related merge requests found
...@@ -36,8 +36,12 @@ function ldapAuth($username, $password) { ...@@ -36,8 +36,12 @@ function ldapAuth($username, $password) {
// people like to use emails to login so lets detect and strip // people like to use emails to login so lets detect and strip
if(filter_var($username, FILTER_VALIDATE_EMAIL)){ if(filter_var($username, FILTER_VALIDATE_EMAIL)){
//valid email, lets strip //valid email, lets strip
$parts = explode("@", $username); // split the email into a string array "@" as a delim
$username = $parts[0]; $s = explode("@",$username);
// remove the last element (domain)
array_pop($s);
// put the array back togther using "@" as a seperator
$username = implode("@",$s);
} }
// ldap servers // ldap servers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment