mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-26 05:00:12 +01:00
ldap auditor access fix
This commit is contained in:
parent
a8b87e0ce1
commit
89d1000c9d
@ -107,7 +107,7 @@ class ModelUserAuth extends Model {
|
|||||||
if(LDAP_AUDITOR_MEMBER_DN == '') { return 0; }
|
if(LDAP_AUDITOR_MEMBER_DN == '') { return 0; }
|
||||||
|
|
||||||
foreach($e as $a) {
|
foreach($e as $a) {
|
||||||
foreach (array("member", "memberof") as $memberattr) {
|
foreach (array("memberof") as $memberattr) {
|
||||||
if(isset($a[$memberattr])) {
|
if(isset($a[$memberattr])) {
|
||||||
|
|
||||||
if(isset($a[$memberattr]['count'])) {
|
if(isset($a[$memberattr]['count'])) {
|
||||||
@ -141,13 +141,13 @@ class ModelUserAuth extends Model {
|
|||||||
for($i = 0; $i < $a[$mailattr]['count']; $i++) {
|
for($i = 0; $i < $a[$mailattr]['count']; $i++) {
|
||||||
if(preg_match("/^smtp\:/i", $a[$mailattr][$i]) || strchr($a[$mailattr][$i], '@') ) {
|
if(preg_match("/^smtp\:/i", $a[$mailattr][$i]) || strchr($a[$mailattr][$i], '@') ) {
|
||||||
$email = strtolower(preg_replace("/^smtp\:/i", "", $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 {
|
else {
|
||||||
$email = strtolower(preg_replace("/^smtp\:/i", "", $a[$mailattr]));
|
$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); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user