diff --git a/plugins/kolab_auth/kolab_auth_ldap.php b/plugins/kolab_auth/kolab_auth_ldap.php index 117db8cb..303bbf3f 100644 --- a/plugins/kolab_auth/kolab_auth_ldap.php +++ b/plugins/kolab_auth/kolab_auth_ldap.php @@ -202,7 +202,9 @@ class kolab_auth_ldap extends rcube_ldap_generic foreach ($this->fieldmap as $field => $attr) { if (array_key_exists($field, $entry)) { $entry[$attr] = $entry[$field]; - unset($entry[$field]); + if ($attr != $field) { + unset($entry[$field]); + } } } @@ -508,6 +510,19 @@ class kolab_auth_ldap extends rcube_ldap_generic return $this->parse_replaces; } + /** + * Register additional fields + */ + public function extend_fieldmap($map) + { + foreach ((array)$map as $name => $attr) { + if (!in_array($attr, $this->attributes)) { + $this->attributes[] = $attr; + $this->fieldmap[$name] = $attr; + } + } + } + /** * HTML-safe DN string encoding * diff --git a/plugins/kolab_delegation/kolab_delegation_engine.php b/plugins/kolab_delegation/kolab_delegation_engine.php index cb906d9f..e346b10e 100644 --- a/plugins/kolab_delegation/kolab_delegation_engine.php +++ b/plugins/kolab_delegation/kolab_delegation_engine.php @@ -240,6 +240,7 @@ class kolab_delegation_engine $this->ldap_org_field = $this->rc->config->get('kolab_auth_organization'); $ldap->set_filter($this->ldap_filter); + $ldap->extend_fieldmap(array($this->ldap_delegate_field => $this->ldap_delegate_field)); return $ldap; } @@ -533,7 +534,7 @@ class kolab_delegation_engine } // Get current user record - $this->cache['user'] = $ldap->get_record($this->ldap_dn, true); + $this->cache['user'] = $ldap->get_record($this->ldap_dn); } return $parsed ? $this->parse_ldap_record($this->cache['user']) : $this->cache['user'];