Allow mixed-case in LDAP attribute names in fieldmap (Bug #2776)

This commit is contained in:
Aleksander Machniak 2014-01-16 14:06:00 +01:00
parent 8996e8fa60
commit fa6fe28b3c

View file

@ -329,9 +329,12 @@ class kolab_auth_ldap extends rcube_ldap_generic
// fields mapping
foreach ($this->fieldmap as $field => $attr) {
if (isset($entry[$attr])) {
$entry[$field] = $entry[$attr];
// $entry is 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
}
return $entry;