summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-12-04 16:56:04 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-12-04 16:56:04 +0000
commitab3b29154427c22a366efafc1e25b7676a6c3338 (patch)
tree75619ca70a9b0b115a6017f0b740d8c5b519637a
parentb601ebd0d936949b0883d5632d129a9b85b5150f (diff)
Accept contact IDs as array or comma-separated string
git-svn-id: https://svn.roundcube.net/trunk@5539 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/include/rcube_ldap.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php
index b25751c21..5c0bd00a5 100644
--- a/roundcubemail/program/include/rcube_ldap.php
+++ b/roundcubemail/program/include/rcube_ldap.php
@@ -1027,7 +1027,7 @@ class rcube_ldap extends rcube_addressbook
$dn = self::dn_encode($dn);
// add new contact to the selected group
- if ($this->groups)
+ if ($this->group_id)
$this->add_to_group($this->group_id, $dn);
return $dn;
@@ -1722,13 +1722,16 @@ class rcube_ldap extends rcube_addressbook
if (($group_cache = $this->cache->get('groups')) === null)
$group_cache = $this->_fetch_groups();
+ if (!is_array($contact_ids))
+ $contact_ids = explode(',', $contact_ids);
+
$base_dn = $this->groups_base_dn;
$group_name = $group_cache[$group_id]['name'];
$member_attr = $group_cache[$group_id]['member_attr'];
$group_dn = "cn=$group_name,$base_dn";
$new_attrs = array();
- foreach (explode(",", $contact_ids) as $id)
+ foreach ($contact_ids as $id)
$new_attrs[$member_attr][] = self::dn_decode($id);
$this->_debug("C: Add [dn: $group_dn]: ".print_r($new_attrs, true));