summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-02-25 15:34:29 +0000
committerthomascube <thomas@roundcube.net>2011-02-25 15:34:29 +0000
commitb8f14ce7442c3a7e1a9e081b88c3108405c7a86e (patch)
tree8f6ff0d4ef9ca41a3f1ce93f0158c721fd271f29 /program/steps
parent6b07e62c7e4d55c2247bcbf885b1ec90fddaeec3 (diff)
Allow multiple records with same e-mail address but show notice to the user
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/addressbook/save.inc13
1 files changed, 3 insertions, 10 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index aa45a4e15..2884aa418 100644
--- a/program/steps/addressbook/save.inc
+++ b/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'];