summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/copy.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-05-04 06:53:56 +0000
committeralecpl <alec@alec.pl>2009-05-04 06:53:56 +0000
commit6fd71e3ed49aa71aa90e4cfd9bfeda4b48a1ab47 (patch)
treefe5cfeade813f7ef169a072fb0adfef5353c5c9f /program/steps/addressbook/copy.inc
parent50d515a7d690f6017d97017f1370705e1a214c27 (diff)
- more addressbooks hooks (#1485829)
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
+?>