summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/copy.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/addressbook/copy.inc')
-rw-r--r--program/steps/addressbook/copy.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc
index 268903bf5..db407497e 100644
--- a/program/steps/addressbook/copy.inc
+++ b/program/steps/addressbook/copy.inc
@@ -26,8 +26,13 @@ if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($t
$success = false;
$TARGET = $RCMAIL->get_address_book($target);
- if ($TARGET && $TARGET->ready && !$TARGET->readonly)
- $success = $TARGET->insert($CONTACTS->search($CONTACTS->primary_key, $cid), true);
+ if ($TARGET && $TARGET->ready && !$TARGET->readonly) {
+ $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $CONTACTS->search($CONTACTS->primary_key, $cid), 'source' => $target));
+ $a_record = $plugin['record'];
+
+ if (!$plugin['abort'])
+ $success = $TARGET->insert($CONTACTS->search($a_record, true);
+ }
if (empty($success))
$OUTPUT->show_message('copyerror', 'error');
@@ -41,4 +46,4 @@ if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($t
// send response
$OUTPUT->send();
-?> \ No newline at end of file
+?>