summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-10-07 11:07:23 +0000
committerthomascube <thomas@roundcube.net>2011-10-07 11:07:23 +0000
commit39cafac3f5e9cff676b379c1ecb1c847eec558e2 (patch)
tree80a79eaf7e4c05d993c3a075fac442ee97eef523 /program/steps/mail
parentbf9644b2192380bb2d41d3510a00266871613efe (diff)
Autocomplete LDAP records when adding contacts from mail (#1488073)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/addcontact.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc
index b74d95faa..dafb2763c 100644
--- a/program/steps/mail/addcontact.inc
+++ b/program/steps/mail/addcontact.inc
@@ -60,6 +60,16 @@ if (!empty($_POST['_address']) && is_object($CONTACTS))
$contact['email'] = rcube_idn_to_utf8($contact['email']);
$contact['name'] = rcube_addressbook::compose_display_name($contact);
+ // validate contact record
+ if (!$CONTACTS->validate($contact, true)) {
+ $error = $CONTACTS->get_error();
+ // TODO: show dialog to complete record
+ // if ($error['type'] == rcube_addressbook::ERROR_VALIDATE) { }
+
+ $OUTPUT->show_message($error['message'] ? $error['message'] : 'errorsavingcontact', 'error');
+ $OUTPUT->send();
+ }
+
// check for existing contacts
$existing = $CONTACTS->search('email', $contact['email'], true, false);