diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-07-13 16:14:37 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-07-13 16:14:37 +0000 |
commit | ea983410993371bcc63e1a120fe17bed964f5f08 (patch) | |
tree | 5bb1cc1bd365b04ba40aba256c9a4b82982a691e /phpBB/login.php | |
parent | 79d57c449fc190ce693d2ecfdbb0dc36e8e82be7 (diff) | |
download | forums-ea983410993371bcc63e1a120fe17bed964f5f08.tar forums-ea983410993371bcc63e1a120fe17bed964f5f08.tar.gz forums-ea983410993371bcc63e1a120fe17bed964f5f08.tar.bz2 forums-ea983410993371bcc63e1a120fe17bed964f5f08.tar.xz forums-ea983410993371bcc63e1a120fe17bed964f5f08.zip |
Changes to include location + some other misc stuff
git-svn-id: file:///svn/phpbb/trunk@646 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/login.php')
-rw-r--r-- | phpBB/login.php | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/phpBB/login.php b/phpBB/login.php index 2adf2d4f00..4d619dd6a5 100644 --- a/phpBB/login.php +++ b/phpBB/login.php @@ -6,11 +6,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * -<<<<<<< login.php * $Id$ -======= - * $Id$ ->>>>>>> 1.21 * * ***************************************************************************/ @@ -25,8 +21,9 @@ * * ***************************************************************************/ -include('extension.inc'); -include('common.'.$phpEx); +$phpbb_root_path = "./"; +include($phpbb_root_path . 'extension.inc'); +include($phpbb_root_path . 'common.'.$phpEx); // // Set page ID for session management @@ -44,19 +41,20 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit'])) $username = $HTTP_POST_VARS['username']; $password = $HTTP_POST_VARS['password']; + $sql = "SELECT user_id, username, user_password, user_active FROM ".USERS_TABLE." WHERE username = '$username'"; $result = $db->sql_query($sql); if(!$result) { - error_die(SQL_QUERY, "Error in obtaining userdata : login", __LINE__, __FILE__); + message_die(GENERAL_ERROR, "Error in obtaining userdata : login", __LINE__, __FILE__, $sql); } $rowresult = $db->sql_fetchrow($result); if(count($rowresult)) { - if((md5($password) == $rowresult['user_password']) && $rowresult['user_active'] != 0) + if((md5($password) == $rowresult['user_password']) && $rowresult['user_active'] != 0) { $autologin = (isset($HTTP_POST_VARS['autologin'])) ? TRUE : FALSE; @@ -75,17 +73,17 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit'])) } else { - error_die(GENERAL_ERROR, "Couldn't start session : login", __LINE__, __FILE__); + message_die(CRITICAL_ERROR, "Couldn't start session : login", __LINE__, __FILE__); } } else { - error_die(LOGIN_FAILED); + message_die(GENERAL_MESSAGE, $lang['Error_login']); } } else { - error_die(LOGIN_FAILED); + message_die(GENERAL_MESSAGE, $lang['Error_login']); } } else if($HTTP_GET_VARS['submit'] == "logout" && $userdata['session_logged_in']) @@ -124,7 +122,8 @@ else if(!$userdata['session_logged_in']) { $page_title = "Log In"; - include('includes/page_header.'.$phpEx); + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + $template->set_filenames(array( "body" => "login_body.tpl") ); @@ -152,8 +151,16 @@ else } } } + else + { + $forward_page = $forward_match[0]; + } } } + else + { + $forward_page = ""; + } $username = ($userdata['user_id'] != ANONYMOUS) ? $userdata['username'] : ""; @@ -169,7 +176,7 @@ else $template->pparse("body"); - include('includes/page_tail.'.$phpEx); + include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } else { |