diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-11 10:31:57 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-11 10:31:57 +0000 |
| commit | 0faafbb6b7c1128941b8a20f8467b665ad321ffc (patch) | |
| tree | 3b1df4606c93ad933086e951b51c79a5786424e2 | |
| parent | a46e4f6333633b9edf7f8e2905ea0ef8877097e4 (diff) | |
- Fix contact information update in case when contact photo exists (#1488420)
git-svn-id: https://svn.roundcube.net/trunk@6058 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/include/rcube_ldap.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_ldap.php b/roundcubemail/program/include/rcube_ldap.php index f42abf1ed..130eada63 100644 --- a/roundcubemail/program/include/rcube_ldap.php +++ b/roundcubemail/program/include/rcube_ldap.php @@ -1109,6 +1109,14 @@ class rcube_ldap extends rcube_addressbook $ldap_data = $this->_map_data($save_cols); $old_data = $record['_raw_attrib']; + // special handling of photo col + if ($photo_fld = $this->fieldmap['photo']) { + // undefined means keep old photo + if (!array_key_exists('photo', $save_cols)) { + $ldap_data[$photo_fld] = $record['photo']; + } + } + foreach ($this->fieldmap as $col => $fld) { if ($fld) { $val = $ldap_data[$fld]; @@ -1121,6 +1129,9 @@ class rcube_ldap extends rcube_addressbook if (is_array($old) && count($old) == 1 && !is_array($val)) { $old = array_pop($old); } + if (is_array($val) && count($val) == 1 && !is_array($old)) { + $val = array_pop($val); + } // Subentries must be handled separately if (!empty($this->prop['sub_fields']) && isset($this->prop['sub_fields'][$fld])) { if ($old != $val) { @@ -1136,6 +1147,7 @@ class rcube_ldap extends rcube_addressbook } continue; } + // The field does exist compare it to the ldap record. if ($old != $val) { // Changed, but find out how. |
