Permalink
Browse files

Allow multiple records with same e-mail address but show notice to th…

…e user
  • Loading branch information...
1 parent 6b07e62 commit b8f14ce7442c3a7e1a9e081b88c3108405c7a86e @thomascube thomascube committed Feb 25, 2011
Showing with 3 additions and 10 deletions.
  1. +3 −10 program/steps/addressbook/save.inc
@@ -204,22 +204,15 @@ if (!empty($cid))
// insert a new contact
else {
- // check for existing contacts
+ // show notice if existing contacts with same e-mail are found
$existing = false;
foreach ($CONTACTS->get_col_values('email', $a_record, true) as $email) {
- if (($res = $CONTACTS->search('email', $email, true, false)) && $res->count) {
- $existing = true;
+ if (($res = $CONTACTS->search('email', $email, false, false)) && $res->count) {
+ $OUTPUT->show_message('contactexists', 'notice', null, false);
break;
}
}
- // show warning message
- if ($existing) {
- $OUTPUT->show_message('contactexists', 'warning', null, false);
- rcmail_overwrite_action('add');
- return;
- }
-
$plugin = $RCMAIL->plugins->exec_hook('contact_create', array(
'record' => $a_record, 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));
$a_record = $plugin['record'];

0 comments on commit b8f14ce

Please sign in to comment.