Fix remapping attribute keys.
authorGunnar Wrobel <p@rdus.de>
Fri, 24 Apr 2009 19:30:26 +0000 (21:30 +0200)
committerGunnar Wrobel <p@rdus.de>
Fri, 24 Apr 2009 19:30:26 +0000 (21:30 +0200)
framework/Kolab_Server/lib/Horde/Kolab/Server/Ldap.php

index d55c32b..f06176d 100644 (file)
@@ -161,9 +161,9 @@ class Horde_Kolab_Server_Ldap extends Horde_Kolab_Server
     {
         if (!empty($this->params['map'])) {
             foreach ($this->params['map'] as $attribute => $map) {
-                if (in_array($attribute, $keys)) {
-                    $keys = array_diff($keys, array($attribute));
-                    $keys[] = $map;
+                $key = array_search($attribute, $keys);
+                if ($key !== false) {
+                    $keys[$key] = $map;
                 }
             }
         }