| | |
| | | 'name' => $contact_arr[1]['name'] |
| | | ); |
| | | |
| | | // Validity checks |
| | | if (empty($contact['email'])) { |
| | | $OUTPUT->show_message('errorsavingcontact', 'error'); |
| | | $OUTPUT->send(); |
| | | } |
| | | else if (!check_email($contact['email'], false)) { |
| | | $OUTPUT->show_message('emailformaterror', 'error', array('email' => $contact['email'])); |
| | | $OUTPUT->send(); |
| | | } |
| | | |
| | | $contact['email'] = idn_to_utf8($contact['email']); |
| | | |
| | | // use email address part for name |
| | |
| | | } |
| | | |
| | | if (!$done) |
| | | $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsavingcontact', 'warning'); |
| | | $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsavingcontact', 'error'); |
| | | |
| | | $OUTPUT->send(); |
| | | |