diff options
author | alecpl <alec@alec.pl> | 2010-08-13 06:25:30 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-08-13 06:25:30 +0000 |
commit | 4612535008a870e0970b9dc645b93e269ac2ed40 (patch) | |
tree | dcc5eff97b179b00c27aaee7810e753cd4055324 | |
parent | b72a1001dc8e4fa7a2245cde4a0556f405eccbc9 (diff) |
- Revert last (unintentional) commit
-rw-r--r-- | program/steps/settings/delete_identity.inc | 15 | ||||
-rw-r--r-- | program/steps/settings/save_identity.inc | 63 |
2 files changed, 38 insertions, 40 deletions
diff --git a/program/steps/settings/delete_identity.inc b/program/steps/settings/delete_identity.inc index 42c1da61f..06bcab906 100644 --- a/program/steps/settings/delete_identity.inc +++ b/program/steps/settings/delete_identity.inc @@ -31,16 +31,13 @@ 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']) { - if ($USER->delete_identity($iid)) { - $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false); - } - else { - $OUTPUT->show_message('nodeletelastidentity', 'error', null, false); - } + + if (!$plugin['abort'] && $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 8673d4099..6c2cd8136 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -64,25 +64,26 @@ if ($_POST['_iid']) $plugin = $RCMAIL->plugins->exec_hook('identity_update', array('id' => $iid, 'record' => $save_data)); $save_data = $plugin['record']; - 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; + 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 + // ... } } + else if ($plugin['abort'] || $DB->is_error()) + { + // show error message + $OUTPUT->show_message('errorsaving', 'error', null, false); + rcmail_overwrite_action('edit-identity'); + return; + } } // insert a new identity record @@ -94,21 +95,21 @@ else if (IDENTITIES_LEVEL < 2) $plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data)); $save_data = $plugin['record']; - if (!$plugin['abort']) { - if ($save_data['email'] && ($insert_id = $USER->insert_identity($save_data))) { - $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); - - $_GET['_iid'] = $insert_id; + 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 (!empty($_POST['_standard'])) - $default_id = $insert_id; - } - else { - // show error message - $OUTPUT->show_message('errorsaving', 'error', null, false); - rcmail_overwrite_action('edit-identity'); - return; - } + 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 |