/** * Rename a specific contact group * * @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, &$new_gid) { $group_cache = $this->_fetch_groups(); $old_dn = $group_cache[$group_id]['dn']; $new_rdn = "cn=" . rcube_ldap_generic::quote_string($new_name, true); $new_gid = self::dn_encode($new_rdn . ',' . $this->groups_base_dn); if (!$this->ldap->rename($old_dn, $new_rdn, null, true)) { $this->set_error(self::ERROR_SAVING, 'errorsaving'); return false; } if ($this->cache) { $this->cache->remove('groups'); } return $new_name; }
/** * Wrapper for ldap_get_entries() * * @param boolean $normalize Optionally normalize the entries to a list of hash arrays * @return array List of LDAP entries */ public function entries($normalize = false) { $entries = ldap_get_entries($this->conn, $this->ldap); return $normalize ? rcube_ldap_generic::normalize_result($entries) : $entries; }