alecpl
2009-05-02 3ddbe667a9e7a7d644588ce8c4f650fae9485cc1
- added create_contact hook in mail/addcontact action (#1485828)


1 files modified
10 ■■■■ changed files
program/steps/mail/addcontact.inc 10 ●●●● patch | view | raw | blame | history
program/steps/mail/addcontact.inc
@@ -41,8 +41,14 @@
    $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');
    }
  }
}