summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-02-15 21:00:48 +0000
committerthomascube <thomas@roundcube.net>2011-02-15 21:00:48 +0000
commit360bd3ea740073b83817183581893681e13a8570 (patch)
treedcbb1d856ceb50d1003fbe811aea07df26cb6096 /program/include
parentbfb7d6e6819c8453d3e7c5c6d4fb261af078b176 (diff)
Allow group identifiers to be changed upon renaming (used in LDAP)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_addressbook.php3
-rw-r--r--program/include/rcube_ldap.php4
2 files changed, 5 insertions, 2 deletions
diff --git a/program/include/rcube_addressbook.php b/program/include/rcube_addressbook.php
index d1b0f6281..9e8254ca4 100644
--- a/program/include/rcube_addressbook.php
+++ b/program/include/rcube_addressbook.php
@@ -310,9 +310,10 @@ abstract class rcube_addressbook
*
* @param string Group identifier
* @param string New name to set for this group
+ * @param string New group identifier (if changed, otherwise don't set)
* @return boolean New name on success, false if no data was changed
*/
- function rename_group($gid, $newname)
+ function rename_group($gid, $newname, &$newid)
{
/* empty for address books don't supporting groups */
return false;
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 3cb47480a..308c4f238 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -995,9 +995,10 @@ class rcube_ldap extends rcube_addressbook
*
* @param string Group identifier
* @param string New name to set for this group
+ * @param string New group identifier (if changed, otherwise don't set)
* @return boolean New name on success, false if no data was changed
*/
- function rename_group($group_id, $new_name)
+ function rename_group($group_id, $new_name, &$new_id)
{
if (!$this->group_cache)
$this->list_groups();
@@ -1006,6 +1007,7 @@ class rcube_ldap extends rcube_addressbook
$group_name = $this->group_cache[$group_id]['name'];
$old_dn = "cn=$group_name,$base_dn";
$new_rdn = "cn=$new_name";
+ $new_id = base64_encode($new_rdn . ",$base_dn");
$res = ldap_rename($this->conn, $old_dn, $new_rdn, NULL, TRUE);
if ($res === false)