From 42b9ce64151f86e4f77d4b01b3fa36461ae9abcc Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 03 Jul 2013 06:00:25 -0400
Subject: [PATCH] Fix groups list in contact info page - get_record_groups() result is a ID=>Name hash and cannot be merged with list_groups() result

---
 program/lib/Roundcube/rcube_ldap.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index 522c81d..29da13c 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -1191,8 +1191,7 @@
             // change the group membership of the contact
             if ($this->groups) {
                 $group_ids = $this->get_record_groups($dn);
-                foreach ($group_ids as $group_id => $group_prop)
-                {
+                foreach (array_keys($group_ids) as $group_id) {
                     $this->remove_from_group($group_id, $dn);
                     $this->add_to_group($group_id, $newdn);
                 }
@@ -1257,7 +1256,7 @@
             if ($this->groups) {
                 $dn = self::dn_encode($dn);
                 $group_ids = $this->get_record_groups($dn);
-                foreach ($group_ids as $group_id => $group_prop) {
+                foreach (array_keys($group_ids) as $group_id) {
                     $this->remove_from_group($group_id, $dn);
                 }
             }
@@ -1879,8 +1878,9 @@
                 $entry['dn'] = $ldap_data->get_dn();
             $group_name = $entry[$name_attr][0];
             $group_id = self::dn_encode($entry['dn']);
-            $groups[$group_id] = array('ID' => $group_id, 'name' => $group_name, 'dn' => $entry['dn']);
+            $groups[$group_id] = $group_name;
         }
+
         return $groups;
     }
 

--
Gitblit v1.9.1