summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-11 22:24:29 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-11 22:24:29 +0000
commit8697e6633c8c5ccfa23dc018f2b88c92089c3e5e (patch)
tree22e8f746f53cbfc7cf07ec9cd8de8658ebd2701b /roundcubemail/program/include
parent8ab6ddf252ddc5e5295f37b5d526838f56ef53d9 (diff)
Fix saving and deleting LDAP contacts; skip client-side input validation for contacts, this is done server-side
git-svn-id: https://svn.roundcube.net/trunk@5049 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_ldap.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php
index 41d722e5b..76217acc1 100644
--- a/roundcubemail/program/include/rcube_ldap.php
+++ b/roundcubemail/program/include/rcube_ldap.php
@@ -728,6 +728,15 @@ class rcube_ldap extends rcube_addressbook
$newdata = array();
$replacedata = array();
$deletedata = array();
+
+ // flatten composite fields in $record
+ if (is_array($record['address'])) {
+ foreach ($record['address'] as $i => $struct) {
+ foreach ($struct as $col => $val) {
+ $record[$col][$i] = $val;
+ }
+ }
+ }
foreach ($this->fieldmap as $col => $fld) {
$val = $save_cols[$col];
@@ -843,10 +852,10 @@ class rcube_ldap extends rcube_addressbook
{
if (!is_array($ids)) {
// Not an array, break apart the encoded DNs.
- $dns = explode(',', $ids);
+ $ids = explode(',', $ids);
} // end if
- foreach ($dns as $id) {
+ foreach ($ids as $id) {
$dn = base64_decode($id);
$this->_debug("C: Delete [dn: $dn]");
// Delete the record.
@@ -869,7 +878,7 @@ class rcube_ldap extends rcube_addressbook
}
} // end foreach
- return count($dns);
+ return count($ids);
}