mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/11144] Add missing {FORUM_NAME} variable
The template variable {FORUM_NAME} was missing from the login page of a password protected forum PHPBB3-11144
This commit is contained in:
parent
453f98f6d3
commit
828d3b6b68
7 changed files with 41 additions and 27 deletions
|
@ -956,6 +956,8 @@ $action_ary = request_var('action', array('' => 0));
|
||||||
<h4>Login checks/redirection: </h4>
|
<h4>Login checks/redirection: </h4>
|
||||||
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
|
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
|
||||||
|
|
||||||
|
<p><code>$forum_data</code> should contain at least the <code>forum_id</code> and <code>forum_password</code> fields. If the field <code>forum_name</code> is available, then it is displayed on the forum login page.</p>
|
||||||
|
|
||||||
<p>The <code>login_box()</code> function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p>
|
<p>The <code>login_box()</code> function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p>
|
||||||
|
|
||||||
<h4>Sensitive Operations: </h4>
|
<h4>Sensitive Operations: </h4>
|
||||||
|
|
|
@ -170,7 +170,7 @@ else
|
||||||
if (!$attachment['in_message'])
|
if (!$attachment['in_message'])
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
$sql = 'SELECT p.forum_id, f.forum_password, f.parent_id
|
$sql = 'SELECT p.forum_id, f.forum_name, f.forum_password, f.parent_id
|
||||||
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
|
FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f
|
||||||
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
|
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
|
||||||
AND p.forum_id = f.forum_id';
|
AND p.forum_id = f.forum_id';
|
||||||
|
|
|
@ -3272,6 +3272,7 @@ function login_forum_box($forum_data)
|
||||||
page_header($user->lang['LOGIN'], false);
|
page_header($user->lang['LOGIN'], false);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '',
|
||||||
'S_LOGIN_ACTION' => build_url(array('f')),
|
'S_LOGIN_ACTION' => build_url(array('f')),
|
||||||
'S_HIDDEN_FIELDS' => build_hidden_fields(array('f' => $forum_data['forum_id'])))
|
'S_HIDDEN_FIELDS' => build_hidden_fields(array('f' => $forum_data['forum_id'])))
|
||||||
);
|
);
|
||||||
|
|
|
@ -271,19 +271,16 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||||
// Passworded forum?
|
// Passworded forum?
|
||||||
if ($post['forum_id'])
|
if ($post['forum_id'])
|
||||||
{
|
{
|
||||||
$sql = 'SELECT forum_password
|
$sql = 'SELECT forum_id, forum_name, forum_password
|
||||||
FROM ' . FORUMS_TABLE . '
|
FROM ' . FORUMS_TABLE . '
|
||||||
WHERE forum_id = ' . (int) $post['forum_id'];
|
WHERE forum_id = ' . (int) $post['forum_id'];
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$forum_password = (string) $db->sql_fetchfield('forum_password');
|
$forum_data = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($forum_password)
|
if (!empty($forum_data['forum_password']))
|
||||||
{
|
{
|
||||||
login_forum_box(array(
|
login_forum_box($forum_data);
|
||||||
'forum_id' => $post['forum_id'],
|
|
||||||
'forum_password' => $forum_password,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,7 @@ if ($post_data['forum_password'])
|
||||||
{
|
{
|
||||||
login_forum_box(array(
|
login_forum_box(array(
|
||||||
'forum_id' => $forum_id,
|
'forum_id' => $forum_id,
|
||||||
|
'forum_name' => $post_data['forum_name'],
|
||||||
'forum_password' => $post_data['forum_password'])
|
'forum_password' => $post_data['forum_password'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,36 @@
|
||||||
<!-- INCLUDE overall_header.html -->
|
<!-- INCLUDE overall_header.html -->
|
||||||
|
|
||||||
<h2 class="solo">{L_LOGIN} {FORUM_NAME}</h2>
|
<!-- IF FORUM_NAME --><h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2><!-- ENDIF -->
|
||||||
|
|
||||||
<form id="login_forum" method="post" action="{S_LOGIN_ACTION}">
|
<form id="login_forum" method="post" action="{S_LOGIN_ACTION}">
|
||||||
{S_FORM_TOKEN}
|
{S_FORM_TOKEN}
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="inner"><span class="corners-top"><span></span></span>
|
<div class="inner"><span class="corners-top"><span></span></span>
|
||||||
|
|
||||||
<p>{L_LOGIN_FORUM}</p>
|
<div class="content">
|
||||||
|
<h2>{L_LOGIN}</h2>
|
||||||
|
|
||||||
<fieldset class="fields2">
|
<p>{L_LOGIN_FORUM}</p>
|
||||||
<!-- IF LOGIN_ERROR -->
|
|
||||||
<dl>
|
<fieldset class="fields1">
|
||||||
<dt> </dt>
|
<!-- IF LOGIN_ERROR -->
|
||||||
<dd class="error">{LOGIN_ERROR}</dd>
|
<dl>
|
||||||
</dl>
|
<dt> </dt>
|
||||||
<!-- ENDIF -->
|
<dd class="error">{LOGIN_ERROR}</dd>
|
||||||
<dl>
|
</dl>
|
||||||
<dt><label for="password">{L_PASSWORD}:</label></dt>
|
<!-- ENDIF -->
|
||||||
<dd><input class="inputbox narrow" type="password" name="password" id="password" size="25" tabindex="1" /></dd>
|
|
||||||
</dl>
|
<dl>
|
||||||
<dl class="fields2">
|
<dt><label for="password">{L_PASSWORD}:</label></dt>
|
||||||
<dt> </dt>
|
<dd><input type="password" tabindex="1" id="password" name="password" size="25" class="inputbox narrow" /></dd>
|
||||||
<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd>
|
</dl>
|
||||||
</dl>
|
{S_LOGIN_REDIRECT}
|
||||||
{S_LOGIN_REDIRECT}
|
<dl>
|
||||||
</fieldset>
|
<dt> </dt>
|
||||||
|
<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd>
|
||||||
|
</dl>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
|
||||||
<span class="corners-bottom"><span></span></span></div>
|
<span class="corners-bottom"><span></span></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
<!-- INCLUDE overall_header.html -->
|
<!-- INCLUDE overall_header.html -->
|
||||||
|
|
||||||
|
<!-- IF FORUM_NAME -->
|
||||||
|
<div id="pageheader">
|
||||||
|
<h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br clear="all" /><br />
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<div id="pagecontent">
|
<div id="pagecontent">
|
||||||
|
|
||||||
<form name="login_forum" method="post" action="{S_LOGIN_ACTION}">
|
<form name="login_forum" method="post" action="{S_LOGIN_ACTION}">
|
||||||
|
|
Loading…
Add table
Reference in a new issue