summaryrefslogtreecommitdiff
path: root/plugins/kolab_auth
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-08-18 12:29:29 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-08-18 12:29:29 (GMT)
commite4100366b5bf28d28015d883d4c50f03bf1bc529 (patch)
treed987ecce7f1e9c1a3c150744b0878473d8b5fa31 /plugins/kolab_auth
parent824db716b4b6f08ca649d5a2a88a77c87f062e10 (diff)
downloadroundcubemail-plugins-kolab-e4100366b5bf28d28015d883d4c50f03bf1bc529.tar.gz
Fix delegatee deletion if configured field name equals attribute name
Fix so delegate field name might be omitted in kolab_auth plugin config (#3400)
Diffstat (limited to 'plugins/kolab_auth')
-rw-r--r--plugins/kolab_auth/kolab_auth_ldap.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/kolab_auth/kolab_auth_ldap.php b/plugins/kolab_auth/kolab_auth_ldap.php
index 117db8c..303bbf3 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]);
+ }
}
}
@@ -509,6 +511,19 @@ class kolab_auth_ldap extends rcube_ldap_generic
}
/**
+ * 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
*
* @param string $str DN string