| | |
| | | define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0))); |
| | | |
| | | $a_save_cols = array('name', 'email', 'organization', 'reply-to', 'bcc', 'standard', 'signature', 'html_signature'); |
| | | $a_html_cols = array('signature'); |
| | | $a_html_cols = array('signature', 'name', 'organization'); |
| | | $a_boolean_cols = array('standard', 'html_signature'); |
| | | $updated = $default_id = false; |
| | | |
| | | // check input |
| | | if (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3)) |
| | | { |
| | | { |
| | | $OUTPUT->show_message('formincomplete', 'warning'); |
| | | rcmail_overwrite_action('edit-identity'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | $save_data = array(); |
| | |
| | | foreach (array('email', 'reply-to', 'bcc') as $item) { |
| | | if ($email = $save_data[$item]) { |
| | | $ascii_email = rcube_idn_to_ascii($email); |
| | | if (!check_email($ascii_email, false)) { |
| | | if (!check_email($ascii_email)) { |
| | | // show error message |
| | | $OUTPUT->show_message('emailformaterror', 'error', array('email' => $email), false); |
| | | rcmail_overwrite_action('edit-identity'); |
| | |
| | | $plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data)); |
| | | $save_data = $plugin['record']; |
| | | |
| | | $save_data['email'] = rcube_idn_to_ascii($save_data['email']); |
| | | $save_data['bcc'] = rcube_idn_to_ascii($save_data['bcc']); |
| | | $save_data['reply-to'] = rcube_idn_to_ascii($save_data['reply-to']); |
| | | if ($save_data['email']) |
| | | $save_data['email'] = rcube_idn_to_ascii($save_data['email']); |
| | | if ($save_data['bcc']) |
| | | $save_data['bcc'] = rcube_idn_to_ascii($save_data['bcc']); |
| | | if ($save_data['reply-to']) |
| | | $save_data['reply-to'] = rcube_idn_to_ascii($save_data['reply-to']); |
| | | |
| | | if (!$plugin['abort']) |
| | | $insert_id = $save_data['email'] ? $USER->insert_identity($save_data) : null; |
| | |
| | | |
| | | if ($insert_id) { |
| | | $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); |
| | | |
| | | |
| | | $_GET['_iid'] = $insert_id; |
| | | |
| | | if (!empty($_POST['_standard'])) |