From 70538ecbaa40792329902381ec76a76d2b0cbbc8 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 04 Aug 2014 02:51:21 -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 bd7f0ac..b158d67 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -1216,8 +1216,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);
}
@@ -1282,7 +1281,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);
}
}
@@ -1894,8 +1893,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