diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-05-06 21:56:20 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-05-06 21:56:20 +0200 |
commit | 841f1e492204b67443f9595e2ecdb571e74aabe9 (patch) | |
tree | 86d6eed8f5f27aaf933a5bd5357c7463fdf4338e /phpBB | |
parent | 92e0613324ac1ddff9c303aaed58eeecb0dfe6b2 (diff) | |
parent | eefcdfa54a80e4f62c88b6758b2e1d22740d1ddd (diff) | |
download | forums-841f1e492204b67443f9595e2ecdb571e74aabe9.tar forums-841f1e492204b67443f9595e2ecdb571e74aabe9.tar.gz forums-841f1e492204b67443f9595e2ecdb571e74aabe9.tar.bz2 forums-841f1e492204b67443f9595e2ecdb571e74aabe9.tar.xz forums-841f1e492204b67443f9595e2ecdb571e74aabe9.zip |
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
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/docs/coding-guidelines.html | 2 | ||||
-rw-r--r-- | phpBB/download/file.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 1 | ||||
-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 54b8526cdf..dd0ee0a82f 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -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> 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..42c4f7bc55 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 @@ <!-- 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> - - <fieldset class="fields2"> - <!-- IF LOGIN_ERROR --> - <dl> - <dt> </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> </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}:</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> <span class="corners-bottom"><span></span></span></div> </div> diff --git a/phpBB/styles/subsilver2/template/login_forum.html b/phpBB/styles/subsilver2/template/login_forum.html index 96b025a2f9..e91a406611 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}"> |