From 3ef900b68fd9016059a1c198e293d180a5ca5bf5 Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 17 Oct 2013 23:22:03 +0200 Subject: [PATCH] sso fixes --- webui/controller/login/sso.php | 1 + webui/model/user/auth.php | 5 +++++ webui/sso.php | 14 +++++--------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/webui/controller/login/sso.php b/webui/controller/login/sso.php index 177322af..f6127503 100644 --- a/webui/controller/login/sso.php +++ b/webui/controller/login/sso.php @@ -12,6 +12,7 @@ class ControllerLoginSSO extends Controller { $request = Registry::get('request'); + $session = Registry::get('session'); $db = Registry::get('db'); diff --git a/webui/model/user/auth.php b/webui/model/user/auth.php index 2b1422a5..2dff7349 100644 --- a/webui/model/user/auth.php +++ b/webui/model/user/auth.php @@ -329,6 +329,11 @@ class ModelUserAuth extends Model { if(isset($a['mail']['count'])) { $username = $a['mail'][0]; } else { $username = $a['mail']; } $username = strtolower(preg_replace("/^smtp\:/i", "", $username)); + if($username == '') { + syslog(LOG_INFO, "no email address found for " . $a['dn']); + return 0; + } + $query = $ldap->query(LDAP_BASE_DN, "(|(&(objectClass=$ldap_account_objectclass)($ldap_mail_attr=$username))(&(objectClass=$ldap_distributionlist_objectclass)($ldap_distributionlist_attr=$username)" . ")(&(objectClass=$ldap_distributionlist_objectclass)($ldap_distributionlist_attr=" . $a['dn'] . ")))", array()); $emails = $this->get_email_array_from_ldap_attr($query->rows); diff --git a/webui/sso.php b/webui/sso.php index 71e16f87..406dbc37 100644 --- a/webui/sso.php +++ b/webui/sso.php @@ -1,25 +1,19 @@