aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-08-30 17:13:28 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-08-30 17:13:28 +0000
commit5e2e08b05dc11992c3c56c45cc93e6d12ff6ae7d (patch)
tree5397c2d9cd57cbce7a8c547f7e394b651a137cfb /phpBB/includes
parent52e9f4d13e5cae7cfac72e515d5a28a8ad0ec0c3 (diff)
downloadforums-5e2e08b05dc11992c3c56c45cc93e6d12ff6ae7d.tar
forums-5e2e08b05dc11992c3c56c45cc93e6d12ff6ae7d.tar.gz
forums-5e2e08b05dc11992c3c56c45cc93e6d12ff6ae7d.tar.bz2
forums-5e2e08b05dc11992c3c56c45cc93e6d12ff6ae7d.tar.xz
forums-5e2e08b05dc11992c3c56c45cc93e6d12ff6ae7d.zip
Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10067 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php23
1 files changed, 7 insertions, 16 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index d6ca262ab8..c6a6d354ce 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2978,28 +2978,18 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
}
}
- if (!$redirect)
- {
- // We just use what the session code determined...
- // If we are not within the admin directory we use the page dir...
- $redirect = '';
-
- if (!$admin)
- {
- $redirect .= ($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '';
- }
-
- $redirect .= $user->page['page_name'] . (($user->page['query_string']) ? '?' . htmlspecialchars($user->page['query_string']) : '');
- }
-
// Assign credential for username/password pair
$credential = ($admin) ? md5(unique_id()) : false;
$s_hidden_fields = array(
- 'redirect' => $redirect,
'sid' => $user->session_id,
);
+ if ($redirect)
+ {
+ $s_hidden_fields['redirect'] = $redirect;
+ }
+
if ($admin)
{
$s_hidden_fields['credential'] = $credential;
@@ -3017,7 +3007,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false,
- 'S_LOGIN_ACTION' => (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id), // Needs to stay index.$phpEx because we are within the admin directory
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_ADMIN_AUTH' => $admin,
@@ -4195,6 +4184,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_FORUM_ID' => $forum_id,
'S_TOPIC_ID' => $topic_id,
+ 'S_LOGIN_ACTION' => (!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url())) : append_sid("index.$phpEx", false, true, $user->session_id) . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url())),
+
'S_ENABLE_FEEDS' => ($config['feed_enable']) ? true : false,
'S_ENABLE_FEEDS_FORUMS' => ($config['feed_overall_forums']) ? true : false,
'S_ENABLE_FEEDS_TOPICS' => ($config['feed_overall_topics']) ? true : false,