diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-09-21 06:44:14 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-09-21 06:44:14 +0000 |
commit | ee8aa910b9db2f90bfb46ba852eaa349343d5e04 (patch) | |
tree | 00b849b68e65ae170278f74c422434f4a0bae55d /modules/user | |
parent | 0741d8e32320f4578853ae92b242c2f7cd2d339a (diff) | |
download | brdo-ee8aa910b9db2f90bfb46ba852eaa349343d5e04.tar.gz brdo-ee8aa910b9db2f90bfb46ba852eaa349343d5e04.tar.bz2 |
Patch #579366 by sun, litwol | chx, Dries: simplified form API redirection handling. I can actually understand it now. ;-).
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.module | 2 | ||||
-rw-r--r-- | modules/user/user.pages.inc | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 9cb594c73..cf41f9d7e 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -3078,7 +3078,7 @@ function user_register($form, &$form_state) { ); // Redirect back to page which initiated the create request; // usually admin/people/create. - $form['destination'] = array('#type' => 'hidden', '#value' => $_GET['q']); + $form_state['redirect'] = $_GET['q']; } // Create a dummy variable for pass-by-reference parameters. diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index ac1115a80..80e00ae49 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -292,9 +292,9 @@ function user_profile_form_submit($form, &$form_state) { */ function user_edit_cancel_submit($form, &$form_state) { $destination = ''; - if (isset($_REQUEST['destination'])) { + if (isset($_GET['destination'])) { $destination = drupal_get_destination(); - unset($_REQUEST['destination']); + unset($_GET['destination']); } // Note: We redirect from user/uid/edit to user/uid/cancel to make the tabs disappear. $form_state['redirect'] = array("user/" . $form_state['values']['_account']->uid . "/cancel", $destination); @@ -391,9 +391,7 @@ function user_cancel_confirm_form_submit($form, &$form_state) { if (user_access('administer users') && empty($form_state['values']['user_cancel_confirm']) && $account->uid != $user->uid) { user_cancel($form_state['values'], $account->uid, $form_state['values']['user_cancel_method']); - if (!isset($_REQUEST['destination'])) { - $form_state['redirect'] = 'admin/people'; - } + $form_state['redirect'] = 'admin/people'; } else { // Store cancelling method and whether to notify the user in $account for @@ -407,9 +405,7 @@ function user_cancel_confirm_form_submit($form, &$form_state) { drupal_set_message(t('A confirmation request to cancel your account has been sent to your e-mail address.')); watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE); - if (!isset($_REQUEST['destination'])) { - $form_state['redirect'] = "user/$account->uid"; - } + $form_state['redirect'] = "user/$account->uid"; } } |