1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 15:17:16 +01:00

Merge remote-tracking branch 'MGaetan89/ticket/11144' into develop-olympus

* MGaetan89/ticket/11144:
  [ticket/11144] Add missing {FORUM_NAME} variable
  [ticket/11144] Add missing {FORUM_NAME} variable
This commit is contained in:
Andreas Fischer 2013-05-06 21:56:20 +02:00
commit 841f1e4922
7 changed files with 41 additions and 27 deletions

View File

@ -956,6 +956,8 @@ $action_ary = request_var('action', array('' => 0));
<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><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>
<h4>Sensitive Operations: </h4>

View File

@ -170,7 +170,7 @@ else
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
WHERE p.post_id = ' . $attachment['post_msg_id'] . '
AND p.forum_id = f.forum_id';

View File

@ -3272,6 +3272,7 @@ function login_forum_box($forum_data)
page_header($user->lang['LOGIN'], false);
$template->assign_vars(array(
'FORUM_NAME' => isset($forum_data['forum_name']) ? $forum_data['forum_name'] : '',
'S_LOGIN_ACTION' => build_url(array('f')),
'S_HIDDEN_FIELDS' => build_hidden_fields(array('f' => $forum_data['forum_id'])))
);

View File

@ -271,19 +271,16 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Passworded forum?
if ($post['forum_id'])
{
$sql = 'SELECT forum_password
$sql = 'SELECT forum_id, forum_name, forum_password
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . (int) $post['forum_id'];
$result = $db->sql_query($sql);
$forum_password = (string) $db->sql_fetchfield('forum_password');
$forum_data = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($forum_password)
if (!empty($forum_data['forum_password']))
{
login_forum_box(array(
'forum_id' => $post['forum_id'],
'forum_password' => $forum_password,
));
login_forum_box($forum_data);
}
}
}

View File

@ -196,6 +196,7 @@ if ($post_data['forum_password'])
{
login_forum_box(array(
'forum_id' => $forum_id,
'forum_name' => $post_data['forum_name'],
'forum_password' => $post_data['forum_password'])
);
}

View File

@ -1,31 +1,36 @@
<!-- 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}">
{S_FORM_TOKEN}
<div class="panel">
<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">
<!-- IF LOGIN_ERROR -->
<dl>
<dt>&nbsp;</dt>
<dd class="error">{LOGIN_ERROR}</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="password">{L_PASSWORD}:</label></dt>
<dd><input class="inputbox narrow" type="password" name="password" id="password" size="25" tabindex="1" /></dd>
</dl>
<dl class="fields2">
<dt>&nbsp;</dt>
<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd>
</dl>
{S_LOGIN_REDIRECT}
</fieldset>
<p>{L_LOGIN_FORUM}</p>
<fieldset class="fields1">
<!-- IF LOGIN_ERROR -->
<dl>
<dt>&nbsp;</dt>
<dd class="error">{LOGIN_ERROR}</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="password">{L_PASSWORD}:</label></dt>
<dd><input type="password" tabindex="1" id="password" name="password" size="25" class="inputbox narrow" /></dd>
</dl>
{S_LOGIN_REDIRECT}
<dl>
<dt>&nbsp;</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>
</div>

View File

@ -1,5 +1,13 @@
<!-- 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">
<form name="login_forum" method="post" action="{S_LOGIN_ACTION}">