diff --git a/webui/model/user/auth.php b/webui/model/user/auth.php index af101380..21cffd67 100644 --- a/webui/model/user/auth.php +++ b/webui/model/user/auth.php @@ -182,12 +182,16 @@ class ModelUserAuth extends Model { $data = array(); foreach($e as $a) { + syslog(LOG_INFO, "checking ldap entry dn: " . $a['dn'] . ", cn: " . $a['cn']); + foreach (array("mail", "mailalternateaddress", "proxyaddresses", "zimbraMailForwardingAddress", "member", "memberOfGroup") as $mailattr) { if(isset($a[$mailattr])) { if(is_array($a[$mailattr])) { for($i = 0; $i < $a[$mailattr]['count']; $i++) { + syslog(LOG_INFO, "checking entry: " . $a[$mailattr][$i]); + $a[$mailattr][$i] = strtolower($a[$mailattr][$i]); if(strchr($a[$mailattr][$i], '@')) { @@ -202,6 +206,8 @@ class ModelUserAuth extends Model { } } else { + syslog(LOG_INFO, "checking entry #2: " . $a[$mailattr]); + $email = strtolower(preg_replace("/^([\w]+)\:/i", "", $a[$mailattr])); if(validemail($email) && !in_array($email, $data)) { array_push($data, $email); } } @@ -370,6 +376,8 @@ class ModelUserAuth extends Model { $this->add_session_vars($a['cn'], $username, $emails, $role); + $this->model_user_prefs->get_user_preferences($username); + AUDIT(ACTION_LOGIN, $username, '', '', 'successful auth against LDAP'); return 1;