From: Meik S. <acy...@ph...> - 2009-08-30 17:14:12
|
Author: acydburn Date: Sun Aug 30 18:13:28 2009 New Revision: 10067 Log: Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285) Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html branches/phpBB-3_0_0/phpBB/includes/functions.php branches/phpBB-3_0_0/phpBB/viewforum.php Modified: branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html (original) --- branches/phpBB-3_0_0/phpBB/docs/CHANGELOG.html Sun Aug 30 18:13:28 2009 *************** *** 230,235 **** --- 230,236 ---- <li>[Change] Unapproved topics can no longer be replied to (Bug #44005)</li> <li>[Change] Require user to be registered and logged in to search for unread posts if topic read tracking is disabled for guests (Bug #49525)</li> <li>[Change] Allow three-digit hex notation in Color BBcode. (Bug #39965 - Patch by m0rpha)</li> + <li>[Change] Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285)</li> <li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li> <li>[Feature] Backported 3.2 captcha plugins. <ul> Modified: branches/phpBB-3_0_0/phpBB/includes/functions.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions.php Sun Aug 30 18:13:28 2009 *************** *** 2978,3005 **** } } - 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 ($admin) { $s_hidden_fields['credential'] = $credential; --- 2978,2995 ---- } } // Assign credential for username/password pair $credential = ($admin) ? md5(unique_id()) : false; $s_hidden_fields = array( 'sid' => $user->session_id, ); + if ($redirect) + { + $s_hidden_fields['redirect'] = $redirect; + } + if ($admin) { $s_hidden_fields['credential'] = $credential; *************** *** 3017,3023 **** '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, --- 3007,3012 ---- *************** *** 4195,4200 **** --- 4184,4191 ---- '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') . '&redirect=' . urlencode(str_replace('&', '&', build_url())) : append_sid("index.$phpEx", false, true, $user->session_id) . '&redirect=' . urlencode(str_replace('&', '&', 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, Modified: branches/phpBB-3_0_0/phpBB/viewforum.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/viewforum.php (original) --- branches/phpBB-3_0_0/phpBB/viewforum.php Sun Aug 30 18:13:28 2009 *************** *** 166,173 **** { $template->assign_vars(array( 'S_NO_READ_ACCESS' => true, - 'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false, - 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&redirect=' . urlencode(str_replace('&', '&', build_url())), )); page_footer(); --- 166,171 ---- |