| | |
| | | if (IDENTITIES_LEVEL == 1 || IDENTITIES_LEVEL == 3) |
| | | unset($save_data['email']); |
| | | |
| | | // Validate e-mail addresses |
| | | foreach (array('email', 'reply-to', 'bcc') as $item) { |
| | | if ($email = $save_data[$item]) { |
| | | $ascii_email = idn_to_ascii($email); |
| | | if (!check_email($ascii_email, false)) { |
| | | // show error message |
| | | $OUTPUT->show_message('emailformaterror', 'error', array('email' => $email), false); |
| | | rcmail_overwrite_action('edit-identity'); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // update an existing contact |
| | | if ($_POST['_iid']) |
| | |
| | | $iid = get_input_value('_iid', RCUBE_INPUT_POST); |
| | | $plugin = $RCMAIL->plugins->exec_hook('identity_update', array('id' => $iid, 'record' => $save_data)); |
| | | $save_data = $plugin['record']; |
| | | |
| | | if ($save_data['email']) |
| | | $save_data['email'] = idn_to_ascii($save_data['email']); |
| | | if ($save_data['bcc']) |
| | | $save_data['bcc'] = idn_to_ascii($save_data['bcc']); |
| | | if ($save_data['reply-to']) |
| | | $save_data['reply-to'] = idn_to_ascii($save_data['reply-to']); |
| | | |
| | | if (!$plugin['abort'] && ($updated = $USER->update_identity($iid, $save_data))) |
| | | { |
| | |
| | | if ($_POST['_framed']) |
| | | { |
| | | // update the changed col in list |
| | | // ... |
| | | // ... |
| | | } |
| | | } |
| | | else if ($plugin['abort'] || $DB->is_error()) |
| | |
| | | $plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data)); |
| | | $save_data = $plugin['record']; |
| | | |
| | | $save_data['email'] = idn_to_ascii($save_data['email']); |
| | | $save_data['bcc'] = idn_to_ascii($save_data['bcc']); |
| | | $save_data['reply-to'] = idn_to_ascii($save_data['reply-to']); |
| | | |
| | | if (!$plugin['abort'] && $save_data['email'] && ($insert_id = $USER->insert_identity($save_data))) |
| | | { |
| | | $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); |