| | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2009, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | Licensed under the GNU General Public License version 3 or | |
| | | | any later version with exceptions for skins & plugins. | |
| | | | See the README file for a full license statement. | |
| | | | | |
| | | | PURPOSE: | |
| | | | Save an identity record or to add a new one | |
| | |
| | | $save_data['reply-to'] = rcube_idn_to_ascii($save_data['reply-to']); |
| | | |
| | | if (!$plugin['abort']) |
| | | $updated = $USER->update_identity($iid, $save_data); |
| | | $updated = $RCMAIL->user->update_identity($iid, $save_data); |
| | | else |
| | | $updated = $plugin['result']; |
| | | |
| | |
| | | |
| | | if ($_POST['_framed']) { |
| | | // update the changed col in list |
| | | // ... |
| | | $OUTPUT->command('parent.update_identity_row', $iid, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>'))); |
| | | } |
| | | } |
| | | else { |
| | |
| | | $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; |
| | | $insert_id = $save_data['email'] ? $RCMAIL->user->insert_identity($save_data) : null; |
| | | else |
| | | $insert_id = $plugin['result']; |
| | | |
| | | if ($insert_id) { |
| | | $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); |
| | | |
| | | |
| | | $_GET['_iid'] = $insert_id; |
| | | |
| | | if (!empty($_POST['_standard'])) |
| | | $default_id = $insert_id; |
| | | |
| | | if ($_POST['_framed']) { |
| | | // add a new row to the list |
| | | $OUTPUT->command('parent.update_identity_row', $insert_id, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>')), true); |
| | | } |
| | | } |
| | | else { |
| | | // show error message |
| | |
| | | |
| | | // mark all other identities as 'not-default' |
| | | if ($default_id) |
| | | $USER->set_default($default_id); |
| | | $RCMAIL->user->set_default($default_id); |
| | | |
| | | // go to next step |
| | | rcmail_overwrite_action('identities'); |
| | | if (!empty($_REQUEST['_framed'])) { |
| | | rcmail_overwrite_action('edit-identity'); |
| | | } |
| | | else |
| | | rcmail_overwrite_action('identities'); |