summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-07 11:07:23 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-07 11:07:23 +0000
commit08ab571eee4a94b5ff31b946b31cbd256d3330fc (patch)
treeda7d5656cffed525cd24958a59485a004a988875 /roundcubemail/program/steps
parent52be32ea38531dfe6ed99ae12b6a3c324c057c0e (diff)
Autocomplete LDAP records when adding contacts from mail (#1488073)
git-svn-id: https://svn.roundcube.net/trunk@5322 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/mail/addcontact.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/addcontact.inc b/roundcubemail/program/steps/mail/addcontact.inc
index b74d95faa..dafb2763c 100644
--- a/roundcubemail/program/steps/mail/addcontact.inc
+++ b/roundcubemail/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);