Changeset 9336ba2 in github
- Timestamp:
- Apr 12, 2012 7:52:09 AM (13 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
- Children:
- 373e3df
- Parents:
- 28391b4
- Location:
- program
- Files:
-
- 2 edited
-
include/rcube_ldap.php (modified) (2 diffs)
-
steps/addressbook/import.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_ldap.php
r21a0d91 r9336ba2 994 994 // try to complete record automatically 995 995 if ($autofix) { 996 $sn_field = $this->fieldmap['surname']; 997 $fn_field = $this->fieldmap['firstname']; 998 $mail_field = $this->fieldmap['email']; 999 1000 // try to extract surname and firstname from displayname 996 1001 $reverse_map = array_flip($this->fieldmap); 997 1002 $name_parts = preg_split('/[\s,.]+/', $save_data['name']); 998 $sn_field = $this->fieldmap['surname'];999 $fn_field = $this->fieldmap['firstname'];1000 1003 1001 1004 if ($sn_field && $missing[$sn_field]) { … … 1007 1010 $save_data['firstname'] = array_shift($name_parts); 1008 1011 unset($missing[$fn_field]); 1012 } 1013 1014 // try to fix missing e-mail, very often on import 1015 // from vCard we have email:other only defined 1016 if ($mail_field && $missing[$mail_field]) { 1017 $emails = $this->get_col_values('email', $save_data, true); 1018 if (!empty($emails) && ($email = array_shift($emails))) { 1019 $save_data['email'] = $email; 1020 unset($missing[$mail_field]); 1021 } 1009 1022 } 1010 1023 } -
program/steps/addressbook/import.inc
r7fe3811 r9336ba2 165 165 166 166 foreach ($vcards as $vcard) { 167 $email = $vcard->email[0]; 168 169 // skip entries without an e-mail address 170 if (empty($email)) { 167 $email = $vcard->email[0]; 168 $a_record = $vcard->get_assoc(); 169 170 // skip entries without an e-mail address or invalid 171 if (empty($email) || !$CONTACTS->validate($a_record, true)) { 171 172 $IMPORT_STATS->nomail++; 172 173 continue; … … 189 190 } 190 191 191 $a_record = $vcard->get_assoc();192 192 $a_record['vcard'] = $vcard->export(); 193 193
Note: See TracChangeset
for help on using the changeset viewer.
