diff options
author | MateBartus <mate.bartus@gmail.com> | 2015-02-24 21:06:53 +0100 |
---|---|---|
committer | MateBartus <mate.bartus@gmail.com> | 2015-02-24 21:06:53 +0100 |
commit | b8dfbfe390590c16cc6a9a829ce17d55482ae230 (patch) | |
tree | d5d6167bbd1b7cee4db8d9bee82151bbc939a3ab /phpBB/includes | |
parent | 56cbff720d49c9ecc22549be2b2f742e539cd1c2 (diff) | |
download | forums-b8dfbfe390590c16cc6a9a829ce17d55482ae230.tar forums-b8dfbfe390590c16cc6a9a829ce17d55482ae230.tar.gz forums-b8dfbfe390590c16cc6a9a829ce17d55482ae230.tar.bz2 forums-b8dfbfe390590c16cc6a9a829ce17d55482ae230.tar.xz forums-b8dfbfe390590c16cc6a9a829ce17d55482ae230.zip |
[ticket/13636] Deleting inactive user in acp_users gives unexpected link
Success message did not provide the expected "previous page" link
(acp_inactive was expected, but the link took users to acp_users) if the
acp_users module was accessed by navigating from the inactive user list to
acp_users and then deleting inactive user.
PHPBB3-13636
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_inactive.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 25 |
2 files changed, 21 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index e96c42de05..473ef01b6a 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -271,7 +271,7 @@ class acp_inactive 'REMINDED_EXPLAIN' => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])), - 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview')), + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview&referer=acp_inactive')), 'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), 'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 3c957a7093..05852bff6d 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -44,6 +44,10 @@ class acp_users $user_id = request_var('u', 0); $action = request_var('action', ''); + $referer = request_var('referer', ''); + $referer_tag = "referer=$referer"; + $referer_url = append_sid("{$phpbb_admin_path}index.$phpEx", "i=$referer"); + $submit = (isset($_POST['update']) && !isset($_POST['cancel'])) ? true : false; $form_name = 'acp_users'; @@ -146,9 +150,9 @@ class acp_users } $template->assign_vars(array( - 'U_BACK' => $this->u_action, + 'U_BACK' => ( (empty($referer)) ? $this->u_action : $referer_url ), 'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&u=$user_id"), - 'U_ACTION' => $this->u_action . '&u=' . $user_id, + 'U_ACTION' => $this->u_action . '&u=' . $user_id . ( (empty($referer)) ? '' : '&' . $referer_tag ), 'S_FORM_OPTIONS' => $s_form_options, 'MANAGED_USERNAME' => $user_row['username']) ); @@ -221,19 +225,30 @@ class acp_users user_delete($delete_type, $user_id, $user_row['username']); add_log('admin', 'LOG_USER_DELETED', $user_row['username']); - trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['USER_DELETED'] . adm_back_link( + (empty($referer)) ? $this->u_action : $referer_url + ) + ); } else { - confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + $delete_confirm_hidden_fields = array( 'u' => $user_id, 'i' => $id, 'mode' => $mode, 'action' => $action, 'update' => true, 'delete' => 1, - 'delete_type' => $delete_type)) + 'delete_type' => $delete_type ); + + // Checks if the redirection page is specified + if (!empty($referer)) + { + $delete_confirm_hidden_fields['referer'] = $referer; + } + + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($delete_confirm_hidden_fields)); } } else |