Code

Made mail address non case sensitive
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Oct 2007 09:30:01 +0000 (09:30 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Oct 2007 09:30:01 +0000 (09:30 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7696 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc

index cc724f8a62807467cc5b295ac272ba36fa7dbcac..dab51ac86293bab88091b538684027e73d23b5a0 100644 (file)
@@ -314,7 +314,7 @@ function ldap_login_user ($username, $password)
 
   /* Check if mail address is also a valid auth name */
   $auth_mail = FALSE;
-  if(isset($config->current['AUTH_MAIL']) && preg_match("/true/",$config->current['AUTH_MAIL'])){
+  if(isset($config->current['AUTH_MAIL']) && preg_match("/^true$/i",$config->current['AUTH_MAIL'])){
     $auth_mail = TRUE;
   }
 
@@ -344,7 +344,7 @@ function ldap_login_user ($username, $password)
   /* LDAP schema is not case sensitive. Perform additional check. */
   $attrs= $ldap->fetch();
   if($auth_mail){
-    if ($attrs['uid'][0] != $username && $attrs['mail'][0] != $username){
+    if ($attrs['uid'][0] != $username && strcasecmp($attrs['mail'][0], $username) != 0){
       return(NULL);
     }
   }else{