summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-05-02 18:47:14 +0000
committeralecpl <alec@alec.pl>2009-05-02 18:47:14 +0000
commit3ddbe667a9e7a7d644588ce8c4f650fae9485cc1 (patch)
tree19d3a749072b5f563da5138a1f107fafca8e4795 /program/steps/mail
parent30b152b1947e773a618bc29bfa3b5b505ceeb1d7 (diff)
- added create_contact hook in mail/addcontact action (#1485828)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/addcontact.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index d98d71faf..6ae0eec65 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -41,8 +41,14 @@ if (!empty($_POST['_address']) && is_object($CONTACTS))
$existing = $CONTACTS->search('email', $contact['email'], true, false);
if ($done = $existing->count)
$OUTPUT->show_message('contactexists', 'warning');
- else if ($done = $CONTACTS->insert($contact))
- $OUTPUT->show_message('addedsuccessfully', 'confirmation');
+ else
+ {
+ $plugin = $RCMAIL->plugins->exec_hook('create_contact', array('record' => $contact, 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));
+ $contact = $plugin['record'];
+
+ if (!$plugin['abort'] && ($done = $CONTACTS->insert($contact)))
+ $OUTPUT->show_message('addedsuccessfully', 'confirmation');
+ }
}
}