diff options
Diffstat (limited to 'program/steps/settings')
-rw-r--r-- | program/steps/settings/delete_identity.inc | 15 | ||||
-rw-r--r-- | program/steps/settings/save_identity.inc | 63 |
2 files changed, 40 insertions, 38 deletions
diff --git a/program/steps/settings/delete_identity.inc b/program/steps/settings/delete_identity.inc index 06bcab906..42c1da61f 100644 --- a/program/steps/settings/delete_identity.inc +++ b/program/steps/settings/delete_identity.inc @@ -31,13 +31,16 @@ if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(RCUBE_INPUT_GPC)) { if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid)) { $plugin = $RCMAIL->plugins->exec_hook('identity_delete', array('id' => $iid)); - - if (!$plugin['abort'] && $USER->delete_identity($iid)) { - $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false); - } - else { - $OUTPUT->show_message('nodeletelastidentity', 'error', null, false); + + if (!$plugin['abort']) { + if ($USER->delete_identity($iid)) { + $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false); + } + else { + $OUTPUT->show_message('nodeletelastidentity', 'error', null, false); + } } + // send response if ($OUTPUT->ajax_call) $OUTPUT->send(); diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index 6c2cd8136..8673d4099 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -64,25 +64,24 @@ if ($_POST['_iid']) $plugin = $RCMAIL->plugins->exec_hook('identity_update', array('id' => $iid, 'record' => $save_data)); $save_data = $plugin['record']; - if (!$plugin['abort'] && ($updated = $USER->update_identity($iid, $save_data))) - { - $OUTPUT->show_message('successfullysaved', 'confirmation'); - - if (!empty($_POST['_standard'])) - $default_id = get_input_value('_iid', RCUBE_INPUT_POST); - - if ($_POST['_framed']) - { - // update the changed col in list - // ... + if (!$plugin['abort']) { + if ($updated = $USER->update_identity($iid, $save_data)) { + $OUTPUT->show_message('successfullysaved', 'confirmation'); + + if (!empty($_POST['_standard'])) + $default_id = get_input_value('_iid', RCUBE_INPUT_POST); + + if ($_POST['_framed']) { + // update the changed col in list + // ... + } + } + else if ($DB->is_error()) { + // show error message + $OUTPUT->show_message('errorsaving', 'error', null, false); + rcmail_overwrite_action('edit-identity'); + return; } - } - else if ($plugin['abort'] || $DB->is_error()) - { - // show error message - $OUTPUT->show_message('errorsaving', 'error', null, false); - rcmail_overwrite_action('edit-identity'); - return; } } @@ -95,21 +94,21 @@ else if (IDENTITIES_LEVEL < 2) $plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data)); $save_data = $plugin['record']; - if (!$plugin['abort'] && $save_data['email'] && ($insert_id = $USER->insert_identity($save_data))) - { - $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); - - $_GET['_iid'] = $insert_id; + if (!$plugin['abort']) { + if ($save_data['email'] && ($insert_id = $USER->insert_identity($save_data))) { + $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); - if (!empty($_POST['_standard'])) - $default_id = $insert_id; - } - else - { - // show error message - $OUTPUT->show_message('errorsaving', 'error', null, false); - rcmail_overwrite_action('edit-identity'); - return; + $_GET['_iid'] = $insert_id; + + if (!empty($_POST['_standard'])) + $default_id = $insert_id; + } + else { + // show error message + $OUTPUT->show_message('errorsaving', 'error', null, false); + rcmail_overwrite_action('edit-identity'); + return; + } } } else |