Changeset 3016 in subversion for trunk/roundcubemail/program/steps/addressbook/copy.inc
- Timestamp:
- Oct 5, 2009 3:20:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/addressbook/copy.inc
r2758 r3016 26 26 $cid = get_input_value('_cid', RCUBE_INPUT_POST); 27 27 $target = get_input_value('_to', RCUBE_INPUT_POST); 28 if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($target) && $target != $source) 28 29 if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($target) && $target !== $source) 29 30 { 30 $success = false;31 $success = 0; 31 32 $TARGET = $RCMAIL->get_address_book($target); 32 33 33 34 if ($TARGET && $TARGET->ready && !$TARGET->readonly) { 34 $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $CONTACTS->search($CONTACTS->primary_key, $cid), 'source' => $target)); 35 $arr_cids = split(',', $cid); 36 foreach ($arr_cids as $cid) { 37 $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $CONTACTS->get_record($cid, true), 'source' => $target)); 35 38 $a_record = $plugin['record']; 36 39 37 40 if (!$plugin['abort']) 38 $success = $TARGET->insert($CONTACTS->search($a_record, true)); 41 if ($TARGET->insert($a_record, true)) 42 $success++; 43 } 39 44 } 40 45 41 if ( empty($success))46 if ($success == 0) 42 47 $OUTPUT->show_message('copyerror', 'error'); 43 48 else 44 $OUTPUT->show_message('copysuccess', 'notice', array('nr' => count($success)));49 $OUTPUT->show_message('copysuccess', 'notice', array('nr' => $success)); 45 50 46 51 // close connection to second address directory
Note: See TracChangeset
for help on using the changeset viewer.
