diff --git a/phpBB/common.php b/phpBB/common.php index 6efc2e560f..5bccc37b2c 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -50,7 +50,6 @@ $image_icq = "$url_images/icq_add.gif"; $image_aim = "$url_images/aim.gif"; $image_yim = "$url_images/yim.gif"; $image_msnm = "$url_images/msnm.gif"; - $theme = array(); // Find Users real IP (if possible) @@ -98,8 +97,6 @@ else $sys_timezone = $config["system_timezone"]; $sys_template = $config['sys_template']; $sys_lang = $default_lang; - - } include('language/lang_'.$default_lang.'.'.$phpEx); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3846c8d1d5..30384b27b0 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -225,7 +225,7 @@ function init_userprefs($userdata) global $theme; if(!$override_user_themes) { - if($userdata['user_id'] != ANONYMOUS || $userdata['user_id'] != DELETED) + if(($userdata['user_id'] != ANONYMOUS || $userdata['user_id'] != DELETED) && $userdata['user_theme']) { $theme = setuptheme($userdata['user_theme']); } diff --git a/phpBB/login.php b/phpBB/login.php index a15351aac8..d73d05716c 100644 --- a/phpBB/login.php +++ b/phpBB/login.php @@ -59,7 +59,14 @@ 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) { - header("Location: index.$phpEx"); + if($forward_page) + { + header("Location: $forward_page"); + } + else + { + header("Location: index.$phpEx"); + } } else { @@ -82,11 +89,25 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit'])) { session_end($userdata["session_id"], $userdata["user_id"]); } - header("Location: index.$phpEx"); + if($forward_page) + { + header("Location: $forward_page"); + } + else + { + header("Location: index.$phpEx"); + } } else { - header("Location: index.$phpEx"); + if($forward_page) + { + header("Location: $forward_page"); + } + else + { + header("Location: index.$phpEx"); + } } } else @@ -98,26 +119,26 @@ else include('includes/page_header.'.$phpEx); $template->set_filenames( array( - "header" => "login_header.tpl", "body" => "login_body.tpl", - "footer" => "login_footer.tpl" ) ); - $template->pparse("header"); - + if($mode) + { + $forward_page .= "?mode=".$mode; + } + $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" => $userdata['username'] ) ); $template->pparse("body"); - $template->pparse("footer"); include('includes/page_tail.'.$phpEx); diff --git a/phpBB/profile.php b/phpBB/profile.php index c0f56b0b14..c9a5f7d61c 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -117,7 +117,77 @@ switch($mode) break; case 'editprofile': + if(!$userdata['session_logged_in']) + { + header("Location: login.$phpEx?forward_page=$PHP_SELF&mode=editprofile"); + } + $pagetype = "register"; + $page_title = "$l_register"; + include('includes/page_header.'.$phpEx); + $template->set_filenames(array("body" => "profile_add_body.tpl")); + $template->assign_vars(array("COPPA" => 0, + "L_SUBMIT" => $l_submit, + "USERNAME" => $userdata['username'], + "EMAIL" => $userdata['user_email'], + "YIM" => $userdata['user_yim'], + "ICQ" => $userdata['user_icq'], + "MSN" => $userdata['user_msnm'], + "AIM" => $userdata['user_aim'], + "OCC" => $userdata['user_occ'], + "SIG" => $userdata['user_sig'], + "INTERESTS" => $userdata['user_interests'], + "FROM" => $userdata['user_from'], + "WEBSITE" => $userdata['user_website'], + "VIEWEMAIL_YES" => ($userdata['user_viewemail']) ? "CHECKED" : "", + "VIEWEMAIL_NO" => (!$userdata['user_viewemail']) ? "CHECKED" : "", + "STOREUSERNAME_YES" => "CHECKED", + "STOREUSERNAME_NO" => "", + "ALWAYSSIG_YES" => ($userdata['user_attachsig']) ? "CHECKED" : "", + "ALWAYSSIG_NO" => (!$userdata['user_attachsig']) ? "CHECKED" : "", + "ALWAYSBBCODE_YES" => ($userdata['user_bbcode']) ? "CHECKED" : "", + "ALWAYSBBCODE_NO" => (!$userdata['user_bbcode']) ? "CHECKED" : "", + "ALWAYSHTML_YES" => ($userdata['user_html']) ? "CHECKED" : "", + "ALWAYSHTML_NO" => (!$userdata['user_html']) ? "CHECKED" : "", + "ALWAYSSMILE_YES" => ($userdata['user_desmile']) ? "CHECKED" : "", + "ALWAYSSMILE_NO" => (!$userdata['user_desmile']) ? "CHECKED" : "", + "LANGUAGE_SELECT" => language_select($default_lang, "lang"), + "THEME_SELECT" => theme_select($theme['theme_id'], $db), + "TIMEZONE_SELECT" => tz_select($userdata['user_timezone']), + "TEMPLATE_SELECT" => template_select($selected_template), + "L_ICQNUMBER" => $l_icqnumber, + "L_STORECOOKIE" => $l_storecookie, + "L_MESSENGER" => $l_messenger, + "L_YAHOO" => $l_yahoo, + "L_WEBSITE" => $l_website, + "L_AIM" => $l_aim, + "L_FROM" => $l_from, + "L_OCC" => $l_occupation, + "L_ALWAYSSMILE" => $l_alwayssmile, + "L_BOARDLANG" => $l_boardlang, + "L_BOARDTHEME" => $l_boardtheme, + "L_BOARDTEMPLATE" => $l_boardtemplate, + "L_TIMEZONE" => $l_timezone, + "L_YES" => $l_yes, + "L_NO" => $l_no, + "L_INTERESTS" => $l_interests, + "L_USERUNIQ" => $l_useruniq, + "L_ALWAYSBBCODE" => $l_alwaysbbcode, + "L_ALWAYSHTML" => $l_alwayshtml, + "L_ALWAYSSIG" => $l_alwayssig, + "L_SIGNATURE" => $l_signature, + "L_SIGEXPLAIN" => $l_sigexplain, + "L_PREFERENCES" => $l_preferences, + "L_PUBLICMAIL" => $l_publicmail, + "L_ITEMSREQ" => $l_itemsreq, + "MODE" => $mode, + "L_REGINFO" => $l_reginfo, + "L_PROFILEINFO" => $l_profileinfo, + "L_CONFIRM" => $l_confirm, + "L_EMAILADDRESS" => $l_emailaddress)); + $template->pparse("body"); + include('includes/page_tail.'.$phpEx); + break; case 'register': @@ -188,7 +258,7 @@ switch($mode) user_website, user_occ, user_from, - user_intrest, + user_interests, user_sig, user_viewemail, user_theme, @@ -252,8 +322,8 @@ switch($mode) } else { - $msg = $l_accountadded; - $email_msg = $l_welcomeemail; + $msg = $l_acountadded; + $email_msg = $l_welcomemail; } if(!$coppa) { @@ -263,6 +333,7 @@ switch($mode) $template->set_filenames(array("reg_header" => "error_body.tpl")); $template->assign_vars(array("ERROR_MESSAGE" => $msg)); $template->pparse("reg_header"); + include('includes/page_tail.'.$phpEx); exit(); } diff --git a/phpBB/templates/Default/login_body.tpl b/phpBB/templates/Default/login_body.tpl index c5f684c2b4..8aa5568d7e 100644 --- a/phpBB/templates/Default/login_body.tpl +++ b/phpBB/templates/Default/login_body.tpl @@ -21,7 +21,7 @@ - + diff --git a/phpBB/templates/Default/profile_add_body.tpl b/phpBB/templates/Default/profile_add_body.tpl index d0bb5825c9..6afe9bea31 100755 --- a/phpBB/templates/Default/profile_add_body.tpl +++ b/phpBB/templates/Default/profile_add_body.tpl @@ -36,7 +36,7 @@ - + @@ -56,7 +56,7 @@ - +
{L_SEND_PASSWORD}
{L_MESSENGER}:
{L_YAHOO}:
{L_INTERESTS}:
{L_SIGNATURE}:
{L_SIGEXPLAIN}