From 89d1000c9d0203d5dbc030c1435f8a6d29f3f82f Mon Sep 17 00:00:00 2001 From: SJ Date: Fri, 3 May 2013 10:06:33 +0200 Subject: [PATCH] ldap auditor access fix --- webui/model/user/auth.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webui/model/user/auth.php b/webui/model/user/auth.php index 728b05dd..b01863d6 100644 --- a/webui/model/user/auth.php +++ b/webui/model/user/auth.php @@ -107,7 +107,7 @@ class ModelUserAuth extends Model { if(LDAP_AUDITOR_MEMBER_DN == '') { return 0; } foreach($e as $a) { - foreach (array("member", "memberof") as $memberattr) { + foreach (array("memberof") as $memberattr) { if(isset($a[$memberattr])) { if(isset($a[$memberattr]['count'])) { @@ -141,13 +141,13 @@ class ModelUserAuth extends Model { for($i = 0; $i < $a[$mailattr]['count']; $i++) { if(preg_match("/^smtp\:/i", $a[$mailattr][$i]) || strchr($a[$mailattr][$i], '@') ) { $email = strtolower(preg_replace("/^smtp\:/i", "", $a[$mailattr][$i])); - if(!in_array($email, $data)) { array_push($data, $email); } + if(!in_array($email, $data) && strchr($email, '@')) { array_push($data, $email); } } } } else { $email = strtolower(preg_replace("/^smtp\:/i", "", $a[$mailattr])); - if(!in_array($email, $data)) { array_push($data, $email); } + if(!in_array($email, $data) && strchr($email, '@')) { array_push($data, $email); } } } }