Fix case-sensitivity in normalization/mapping of LDAP entries (Bug #2905)

This commit is contained in:
Aleksander Machniak 2014-03-14 14:05:26 +01:00
parent df2ed0d8e6
commit 32ffbe0ade

View file

@ -329,12 +329,14 @@ class kolab_auth_ldap extends rcube_ldap_generic
// fields mapping
foreach ($this->fieldmap as $field => $attr) {
// $entry is indexed by lower-case attribute names
// $entry might be indexed by lower-case attribute names
$attr_lc = strtolower($attr);
if (isset($entry[$attr_lc])) {
$entry[$field] = $entry[$attr_lc];
}
// @TODO: consider returning also $entry[$attr] when $attr != $attr_lc
else if (isset($entry[$attr])) {
$entry[$field] = $entry[$attr];
}
}
return $entry;