diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ba203c9281..c36b56710e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -268,4 +268,23 @@ function create_date($format, $gmepoch, $tz)
{
return (gmdate($format, $gmepoch + (3600 * $tz)));
}
-?>
+
+//
+// Append $SID to a url
+// Borrowed from phplib
+//
+function append_sid($url)
+{
+ global $SID;
+
+ if(!empty($SID) && !eregi("^http:", $url) && !eregi("sid=", $url))
+ {
+ $url = ereg_replace("[&?]+$", "", $url);
+ $url .= ( strpos($url, "?") != false ? "&" : "?" ) . $SID;
+ }
+
+ return($url);
+
+}
+
+?>
\ No newline at end of file
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index 3c542946b9..c6ea57e173 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -37,7 +37,7 @@ $template->set_filenames(array(
if($userdata['session_logged_in'])
{
$logged_in_status = "You are logged in as ".$userdata["username"].".";
- $logged_in_status .= " [Logout]";
+ $logged_in_status .= " [Logout]";
$u_login_logout = "login.$phpEx?submit=logout";
$l_login_logout = "$l_logout : ".$userdata["username"]."";
@@ -86,7 +86,7 @@ while($row = $db->sql_fetchrow($result))
{
if($row['session_logged_in'])
{
- $userlist_ary[] = "" . $row['username'] . "";
+ $userlist_ary[] = "" . $row['username'] . "";
$logged_online++;
}
else
@@ -114,6 +114,7 @@ $template->assign_vars(array(
"L_USERNAME" => $l_username,
"L_PASSWORD" => $l_password,
+ "L_LOGIN" => $l_login,
"L_LOG_ME_IN" => $l_log_me_in,
"L_WELCOMETO" => $l_welcometo,
"L_INDEX" => $l_indextitle,
@@ -150,20 +151,23 @@ $template->assign_vars(array(
"L_LOGIN_LOGOUT" => $l_login_logout,
- "U_INDEX" => "index.".$phpEx,
- "U_REGISTER" => "profile.".$phpEx."?mode=register",
- "U_PROFILE" => "profile.".$phpEx."?mode=editprofile",
- "U_PRIVATEMSGS" => "priv_msgs.".$phpEx."?mode=read",
- "U_SEARCH" => "search.".$phpEx,
- "U_MEMBERLIST" => "memberlist.".$phpEx,
- "U_FAQ" => "faq.".$phpEx,
- "U_VIEWONLINE" => "viewonline.$phpEx",
- "U_LOGIN_LOGOUT" => $u_login_logout,
+ "U_INDEX" => append_sid("index.".$phpEx),
+ "U_REGISTER" => append_sid("profile.".$phpEx."?mode=register"),
+ "U_PROFILE" => append_sid("profile.".$phpEx."?mode=editprofile"),
+ "U_PRIVATEMSGS" => append_sid("priv_msgs.".$phpEx."?mode=read"),
+ "U_SEARCH" => append_sid("search.".$phpEx),
+ "U_MEMBERLIST" => append_sid("memberlist.".$phpEx),
+ "U_FAQ" => append_sid("faq.".$phpEx),
+ "U_VIEWONLINE" => append_sid("viewonline.$phpEx"),
+ "U_LOGIN_LOGOUT" => append_sid($u_login_logout),
"S_TIMEZONE" => $s_timezone,
"S_FORUMS_URL" => POST_FORUM_URL,
"S_TOPICS_URL" => POST_TOPIC_URL,
"S_USERS_URL" => POST_USERS_URL,
+ "S_LOGIN_ACTION" => append_sid("login.$phpEx"),
+ "S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"),
+ "S_PROFILE_ACTION" => append_sid("profile.$phpEx"),
"T_HEAD_STYLESHEET" => $theme['head_stylesheet'],
"T_BODY_BACKGROUND" => $theme['body_background'],
@@ -217,13 +221,18 @@ switch($pagetype)
$template->set_filenames(array(
"header" => "index_header.tpl",
"body" => "index_body.tpl",
- "footer" => "index_footer.tpl"));
+ "footer" => "index_footer.tpl")
+ );
$template->assign_vars(array(
"TOTAL_POSTS" => $total_posts,
"TOTAL_USERS" => $total_users,
"NEWEST_USER" => $newest_user,
"NEWEST_UID" => $newest_uid,
- "USERS_BROWSING" => $users_browsing));
+ "USERS_BROWSING" => $users_browsing,
+
+ "U_NEWEST_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=$newest_uid"))
+ );
+
$template->pparse("header");
break;
@@ -232,18 +241,20 @@ switch($pagetype)
"header" => "viewforum_header.tpl",
"body" => "viewforum_body.tpl",
"jumpbox" => "jumpbox.tpl",
- "footer" => "viewforum_footer.tpl"));
+ "footer" => "viewforum_footer.tpl")
+ );
$jumpbox = make_jumpbox();
$template->assign_vars(array(
"JUMPBOX_LIST" => $jumpbox,
- "JUMPBOX_ACTION" => "viewforum.".$phpEx,
- "SELECT_NAME" => POST_FORUM_URL));
+ "SELECT_NAME" => POST_FORUM_URL)
+ );
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array(
"FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
"MODERATORS" => $forum_moderators,
- "USERS_BROWSING" => $users_browsing));
+ "USERS_BROWSING" => $users_browsing)
+ );
$template->pparse("header");
break;
@@ -252,12 +263,13 @@ switch($pagetype)
"header" => "viewtopic_header.tpl",
"body" => "viewtopic_body.tpl",
"jumpbox" => "jumpbox.tpl",
- "footer" => "viewtopic_footer.tpl"));
+ "footer" => "viewtopic_footer.tpl")
+ );
$jumpbox = make_jumpbox();
$template->assign_vars(array(
"JUMPBOX_LIST" => $jumpbox,
- "JUMPBOX_ACTION" => "viewforum.".$phpEx,
- "SELECT_NAME" => POST_FORUM_URL));
+ "SELECT_NAME" => POST_FORUM_URL)
+ );
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array(
"FORUM_ID" => $forum_id,
@@ -265,7 +277,8 @@ switch($pagetype)
"TOPIC_ID" => $topic_id,
"TOPIC_TITLE" => $topic_title,
"POST_FORUM_URL" => POST_FORUM_URL,
- "USERS_BROWSING" => $users_browsing));
+ "USERS_BROWSING" => $users_browsing)
+ );
$template->pparse("header");
break;
@@ -274,19 +287,23 @@ switch($pagetype)
"header" => "viewonline_header.tpl",
"body" => "viewonline_body.tpl",
"jumpbox" => "jumpbox.tpl",
- "footer" => "viewonline_footer.tpl"));
+ "footer" => "viewonline_footer.tpl")
+ );
$jumpbox = make_jumpbox();
$template->assign_vars(array(
"JUMPBOX_LIST" => $jumpbox,
- "JUMPBOX_ACTION" => "viewforum.".$phpEx,
- "SELECT_NAME" => POST_FORUM_URL));
+ "SELECT_NAME" => POST_FORUM_URL)
+ );
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array(
"TOTAL_POSTS" => $total_posts,
"TOTAL_USERS" => $total_users,
"POST_USER_URL" => POST_USERS_URL,
"NEWEST_USER" => $newest_user,
- "NEWEST_UID" => $newest_uid));
+ "NEWEST_UID" => $newest_uid,
+
+ "U_NEWEST_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=$newest_uid"))
+ );
$template->pparse("header");
break;
@@ -294,17 +311,19 @@ switch($pagetype)
$template->set_filenames(array(
"header" => "newtopic_header.tpl",
"jumpbox" => "jumpbox.tpl",
- "body" => "posting_body.tpl"));
+ "body" => "posting_body.tpl")
+ );
$jumpbox = make_jumpbox();
$template->assign_vars(array(
"JUMPBOX_LIST" => $jumpbox,
- "JUMPBOX_ACTION" => "viewforum.".$phpEx,
- "SELECT_NAME" => POST_FORUM_URL));
+ "SELECT_NAME" => POST_FORUM_URL)
+ );
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$template->assign_vars(array(
"L_POSTNEWIN" => $l_postnewin,
"FORUM_ID" => $forum_id,
- "FORUM_NAME" => $forum_name));
+ "FORUM_NAME" => $forum_name)
+ );
$template->pparse("header");
break;
@@ -314,20 +333,27 @@ switch($pagetype)
$coppa = (!isset($HTTP_POST_VARS['coppa'])) ? FALSE : TRUE;
$template->set_filenames(array(
- "body" => "agreement.tpl"));
+ "body" => "agreement.tpl")
+ );
$template->assign_vars(array(
- "COPPA" => $coppa));
+ "COPPA" => $coppa,
+
+ "U_AGREE_OVER13" => append_sid("profile.$phpEx?mode=register&agreed=true"),
+ "U_AGREE_UNDER13" => append_sid("profile.$phpEx?mode=register&agreed=true&coppa=true"))
+ );
}
else
{
$template->set_filenames(array(
- "body" => "profile_add_body.tpl"));
+ "body" => "profile_add_body.tpl")
+ );
}
break;
case 'profile':
$template->set_filenames(array(
- "body" => "profile_view_body.tpl"));
+ "body" => "profile_view_body.tpl")
+ );
break;
}
diff --git a/phpBB/index.php b/phpBB/index.php
index 33211f2ffd..9d7c118290 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -111,7 +111,7 @@ if($total_categories)
array(
"CAT_ID" => $category_rows[$i]["cat_id"],
"CAT_DESC" => stripslashes($category_rows[$i]["cat_title"]),
- "U_VIEWCAT" => "index." . $phpEx . "?viewcat=" . $category_rows[$i]['cat_id']
+ "U_VIEWCAT" => append_sid("index." . $phpEx . "?viewcat=" . $category_rows[$i]['cat_id'])
)
);
@@ -129,8 +129,8 @@ if($total_categories)
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_rows[$j]["post_time"], $board_config['default_timezone']);
$last_post = $last_post_time."
by ";
- $last_post .= "".$forum_rows[$j]["username"]."
";
+ $last_post .= "".$forum_rows[$j]["username"]."
";
}
else
{
@@ -158,7 +158,7 @@ if($total_categories)
{
$moderators_links .= "
";
}
- $moderators_links .= "".$forum_mods["forum_".$forum_rows[$j]["forum_id"]."_name"][$mods]."";
+ $moderators_links .= "".$forum_mods["forum_".$forum_rows[$j]["forum_id"]."_name"][$mods]."";
}
$template->assign_block_vars("catrow.forumrow",
@@ -172,7 +172,7 @@ if($total_categories)
"LAST_POST" => $last_post,
"MODERATORS" => $moderators_links,
- "U_VIEWFORUM" => "viewforum." . $phpEx . "?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id'] . "&" . $forum_rows[$j]['forum_posts'])
+ "U_VIEWFORUM" => append_sid("viewforum." . $phpEx . "?" . POST_FORUM_URL . "=" . $forum_rows[$j]['forum_id'] . "&" . $forum_rows[$j]['forum_posts']))
);
// "LAST_POST_USER" => "$forum_rows[$j]["username"]",
// "U_LAST_POST_USER_PROFILE" => "profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$forum_rows[$j]["user_id"]",
diff --git a/phpBB/login.php b/phpBB/login.php
index 6fa3161bfc..ed35c262b9 100644
--- a/phpBB/login.php
+++ b/phpBB/login.php
@@ -59,13 +59,13 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit']))
$session_id = session_begin($rowresult["user_id"], $user_ip, PAGE_INDEX, $session_length, TRUE, $autologin);
if($session_id)
{
- if($forward_page)
+ if(!empty($HTTP_POST_VARS['forward_page']))
{
- header("Location: $forward_page");
+ header(append_sid("Location: ".$HTTP_POST_VARS['forward_page']));
}
else
{
- header("Location: index.$phpEx");
+ header(append_sid("Location: index.$phpEx"));
}
}
else
@@ -89,24 +89,24 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit']))
{
session_end($userdata["session_id"], $userdata["user_id"]);
}
- if($forward_page)
+ if(!empty($HTTP_POST_VARS['forward_page']))
{
- header("Location: $forward_page");
+ header(append_sid("Location: ".$HTTP_POST_VARS['forward_page']));
}
else
{
- header("Location: index.$phpEx");
+ header(append_sid("Location: index.$phpEx"));
}
}
else
{
- if($forward_page)
+ if(!empty($HTTP_POST_VARS['forward_page']))
{
- header("Location: $forward_page");
+ header(append_sid("Location: ".$HTTP_POST_VARS['forward_page']));
}
else
{
- header("Location: index.$phpEx");
+ header(append_sid("Location: index.$phpEx"));
}
}
}
@@ -131,13 +131,12 @@ else
$username = ($userdata['user_id'] != ANONYMOUS) ? $userdata['username'] : "";
$template->assign_vars(array(
- "L_USERNAME" => $l_username,
- "L_PASSWORD" => $l_password,
"L_SEND_PASSWORD" => $l_resend_password,
- "L_LOGIN" => $l_login,
- "U_SEND_PASSWORD" => "sendpassword.".$phpEx,
+
"FORWARD_PAGE" => $forward_page,
- "USERNAME" => $username
+ "USERNAME" => $username,
+
+ "U_SEND_PASSWORD" => append_sid("sendpassword.".$phpEx)
)
);
diff --git a/phpBB/templates/Default/agreement.tpl b/phpBB/templates/Default/agreement.tpl
index 99ba618abe..e7f9dfd9e7 100755
--- a/phpBB/templates/Default/agreement.tpl
+++ b/phpBB/templates/Default/agreement.tpl
@@ -21,9 +21,9 @@
The owners of phpBB.com and the moderators of this forum have the right to remove, edit, move or close any thread for any reason.
-
+
diff --git a/phpBB/templates/Default/index_header.tpl b/phpBB/templates/Default/index_header.tpl
index 622b26e77b..a7e8ebae14 100644
--- a/phpBB/templates/Default/index_header.tpl
+++ b/phpBB/templates/Default/index_header.tpl
@@ -7,8 +7,8 @@
{L_POSTEDTOTAL} -{TOTAL_POSTS}- {L_MESSAGES}.
{L_WEHAVE} {TOTAL_USERS} {L_REGUSERS}.
- {L_NEWESTUSER} {NEWEST_USER}
- {L_ARECURRENTLY} {USERS_BROWSING} {L_BROWSING} {L_THEFORUMS}
+ {L_NEWESTUSER} {NEWEST_USER}
+ {L_ARECURRENTLY} {USERS_BROWSING} {L_BROWSING} {L_THEFORUMS}
|
diff --git a/phpBB/templates/Default/jumpbox.tpl b/phpBB/templates/Default/jumpbox.tpl
index de3d93e8f5..72ec34c222 100644
--- a/phpBB/templates/Default/jumpbox.tpl
+++ b/phpBB/templates/Default/jumpbox.tpl
@@ -1,5 +1,5 @@
\ No newline at end of file
diff --git a/phpBB/templates/Default/login_body.tpl b/phpBB/templates/Default/login_body.tpl
index d987177de0..0aad58a463 100644
--- a/phpBB/templates/Default/login_body.tpl
+++ b/phpBB/templates/Default/login_body.tpl
@@ -2,7 +2,7 @@
|