From b8f14ce7442c3a7e1a9e081b88c3108405c7a86e Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Fri, 25 Feb 2011 10:34:29 -0500 Subject: [PATCH] Allow multiple records with same e-mail address but show notice to the user --- program/steps/addressbook/save.inc | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index aa45a4e..2884aa4 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -204,20 +204,13 @@ // 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( -- Gitblit v1.9.1