diff options
-rw-r--r-- | phpBB/docs/coding-guidelines.html | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 1 | ||||
-rw-r--r-- | phpBB/includes/functions_download.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 11 | ||||
-rw-r--r-- | phpBB/posting.php | 1 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/login_forum.html | 45 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/login_forum.html | 8 |
7 files changed, 42 insertions, 28 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index d2bafb6c92..e73c563d5b 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1060,6 +1060,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> diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3a650b37fc..0dc2f314f1 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3467,6 +3467,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/functions_download.php b/phpBB/includes/functions_download.php index 9ae647d806..ee4e2f5135 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -625,7 +625,7 @@ function phpbb_increment_downloads($db, $ids) */ function phpbb_download_handle_forum_auth($db, $auth, $topic_id) { - $sql = 'SELECT t.forum_id, f.forum_password, f.parent_id + $sql = 'SELECT t.forum_id, f.forum_name, f.forum_password, f.parent_id FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f WHERE t.topic_id = " . (int) $topic_id . " AND t.forum_id = f.forum_id"; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index c2d12d17c2..e0e7a46494 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -265,19 +265,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 d32f7e33d9..c6b9ff4cce 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -228,6 +228,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 63f0b2e0f7..c83a625b3f 100644 --- a/phpBB/styles/prosilver/template/login_forum.html +++ b/phpBB/styles/prosilver/template/login_forum.html @@ -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"> - <p>{L_LOGIN_FORUM}</p> - - <fieldset class="fields2"> - <!-- IF LOGIN_ERROR --> - <dl> - <dt> </dt> - <dd class="error">{LOGIN_ERROR}</dd> - </dl> - <!-- ENDIF --> - <dl> - <dt><label for="password">{L_PASSWORD}{L_COLON}</label></dt> - <dd><input class="inputbox narrow" type="password" name="password" id="password" size="25" tabindex="1" /></dd> - </dl> - <dl class="fields2"> - <dt> </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> + <div class="content"> + <h2>{L_LOGIN}</h2> + + <p>{L_LOGIN_FORUM}</p> + + <fieldset class="fields1"> + <!-- IF LOGIN_ERROR --> + <dl> + <dt> </dt> + <dd class="error">{LOGIN_ERROR}</dd> + </dl> + <!-- ENDIF --> + + <dl> + <dt><label for="password">{L_PASSWORD}{L_COLON}</label></dt> + <dd><input type="password" tabindex="1" id="password" name="password" size="25" class="inputbox narrow" /></dd> + </dl> + {S_LOGIN_REDIRECT} + <dl> + <dt> </dt> + <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd> + </dl> + </fieldset> + </div> </div> </div> diff --git a/phpBB/styles/subsilver2/template/login_forum.html b/phpBB/styles/subsilver2/template/login_forum.html index c9b2c7277e..9a141fc295 100644 --- a/phpBB/styles/subsilver2/template/login_forum.html +++ b/phpBB/styles/subsilver2/template/login_forum.html @@ -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}"> |