mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 13:30:25 +02:00
[ticket/16054] Restore ability to login from any template.
Moving the login form's add_form_key() work into page_header(), so that the template variables required for presenting a login form are again available to any template that chooses to consume them. PHPBB3-16054
This commit is contained in:
@@ -2526,9 +2526,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||
));
|
||||
}
|
||||
|
||||
// Add form token for login box
|
||||
add_form_key($form_name, '_LOGIN');
|
||||
|
||||
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
|
||||
|
||||
$login_box_template_data = array(
|
||||
@@ -2663,9 +2660,6 @@ function login_forum_box($forum_data)
|
||||
|
||||
page_header($user->lang['LOGIN']);
|
||||
|
||||
// Add form token for login box
|
||||
add_form_key('login', '_LOGIN');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '',
|
||||
'S_LOGIN_ACTION' => build_url(array('f')),
|
||||
@@ -4439,6 +4433,10 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||
$notification_mark_hash = generate_link_hash('mark_all_notifications_read');
|
||||
|
||||
$s_login_redirect = build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url())));
|
||||
|
||||
// Add form token for login box, in case page is presenting a login form.
|
||||
add_form_key('login', '_LOGIN');
|
||||
|
||||
/**
|
||||
* Workaround for missing template variable in pre phpBB 3.2.6 styles.
|
||||
* @deprecated 3.2.7 (To be removed: 3.3.0-a1)
|
||||
|
Reference in New Issue
Block a user