summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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');
+ }
}
}