summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-08-11 22:24:29 +0000
committerthomascube <thomas@roundcube.net>2011-08-11 22:24:29 +0000
commit0f1faec39271130500b836d8c81ce060fc5cbc07 (patch)
treeedcc42ec963a0370eadcf72663825ce1639808c6 /program/include
parent077cfdac2d979f177489495d6e6524377756f832 (diff)
Fix saving and deleting LDAP contacts; skip client-side input validation for contacts, this is done server-side
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_ldap.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 41d722e5b..76217acc1 100644
--- a/program/include/rcube_ldap.php
+++ b/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);
}