From 6fd71e3ed49aa71aa90e4cfd9bfeda4b48a1ab47 Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 4 May 2009 06:53:56 +0000 Subject: - more addressbooks hooks (#1485829) --- program/steps/addressbook/copy.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'program/steps/addressbook/copy.inc') 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 +?> -- cgit v1.2.3