| | |
| | | $OUTPUT->show_message('errorsavingcontact', 'error'); |
| | | $OUTPUT->send(); |
| | | } |
| | | |
| | | |
| | | $email = rcube_idn_to_ascii($contact['email']); |
| | | if (!check_email($email, false)) { |
| | | $OUTPUT->show_message('emailformaterror', 'error', array('email' => $contact['email'])); |
| | |
| | | $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); |
| | | $existing = $CONTACTS->search('email', $contact['email'], 1, false); |
| | | |
| | | if ($done = $existing->count) |
| | | $OUTPUT->show_message('contactexists', 'warning'); |