diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-05-02 18:47:14 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-05-02 18:47:14 +0000 |
| commit | 585607421825e5de6d6f22241839a2fd1124a6f3 (patch) | |
| tree | b9b68dff1c23dd4deac715c88931a10a17c693b8 | |
| parent | 3090dd61d7e0071c48de147bd38638809430ba98 (diff) | |
- added create_contact hook in mail/addcontact action (#1485828)
git-svn-id: https://svn.roundcube.net/trunk@2447 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/steps/mail/addcontact.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/addcontact.inc b/roundcubemail/program/steps/mail/addcontact.inc index d98d71faf..6ae0eec65 100644 --- a/roundcubemail/program/steps/mail/addcontact.inc +++ b/roundcubemail/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'); + } } } |
