diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index cd113a7226..38f11534d2 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -956,6 +956,8 @@ $action_ary = request_var('action', array('' => 0));
Login checks/redirection:
To show a forum login box use login_forum_box($forum_data)
, else use the login_box()
function.
+ $forum_data
should contain at least the forum_id
and forum_password
fields. If the field forum_name
is available, then it is displayed on the forum login page.
+
The login_box()
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 $SID
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).
Sensitive Operations:
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index bf277c69fa..3ceb1ee0cc 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -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';
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ccd2d3147c..98a1dab722 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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'])))
);
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 8e82188aff..d7509a1072 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -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);
}
}
}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index e57f5420f5..b351f67218 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -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'])
);
}
diff --git a/phpBB/styles/prosilver/template/login_forum.html b/phpBB/styles/prosilver/template/login_forum.html
index a342a9aa24..81a83b6340 100644
--- a/phpBB/styles/prosilver/template/login_forum.html
+++ b/phpBB/styles/prosilver/template/login_forum.html
@@ -1,31 +1,36 @@
-{L_LOGIN} {FORUM_NAME}
+