diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-04-15 17:33:02 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-04-15 17:33:02 +0000 |
| commit | 13c7b8d39d5667b5fded7ff805ebc0337464f773 (patch) | |
| tree | 0b57f552fc7df2f148e08a066422fd8ee65584c6 /phpBB/functions/error.php | |
| parent | eecdd3049f42166975864d2c1eb359ba09c9c229 (diff) | |
| download | forums-13c7b8d39d5667b5fded7ff805ebc0337464f773.tar forums-13c7b8d39d5667b5fded7ff805ebc0337464f773.tar.gz forums-13c7b8d39d5667b5fded7ff805ebc0337464f773.tar.bz2 forums-13c7b8d39d5667b5fded7ff805ebc0337464f773.tar.xz forums-13c7b8d39d5667b5fded7ff805ebc0337464f773.zip | |
error_die changes and various bug fixes
git-svn-id: file:///svn/phpbb/trunk@150 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/functions/error.php')
| -rw-r--r-- | phpBB/functions/error.php | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/phpBB/functions/error.php b/phpBB/functions/error.php index d8027e1fad..76acc188e5 100644 --- a/phpBB/functions/error.php +++ b/phpBB/functions/error.php @@ -22,9 +22,12 @@ * ***************************************************************************/ -function error_die($db, $error_code = "", $error_msg = "") +function error_die($error_code, $error_msg = "", $line = "", $file = "") { - global $template, $phpEx, $default_lang; + global $db, $template, $phpEx, $default_lang; + global $table_bgcolor, $color1; + global $starttime, $phpbbversion; + if(!defined("HEADER_INC")) { if(!empty($default_lang)) @@ -46,41 +49,48 @@ function error_die($db, $error_code = "", $error_msg = "") { $error_msg = "An Error Occured"; } - break; + break; + case SQL_CONNECT: $db_error = $db->sql_error(); - $error_msg = "Error: phpBB could not connect to the database. Reason: " . $db_error["message"]; - break; + $error_msg .= "<br />SQL connect error - " . $db_error["message"]; + break; + case BANNED: $error_msg = "You have been banned from this forum."; - break; - case QUERY_ERROR: + break; + + case SQL_QUERY: $db_error = $db->sql_error(); - $error_msg = "Error: phpBB could not query the database. Reason: " . $db_error["message"]; - break; + $error_msg .= "<br />SQL query error - ".$db_error["message"]; + break; + case SESSION_CREATE: $error_msg = "Error creating session. Could not log you in. Please go back and try again."; - break; + break; + case NO_POSTS: - $error_msg = "There are no posts in this forum. Click on the 'Post New Topic' link on this page to post one."; - break; + $error_msg = "There are no posts in this forum. Click on the <b>Post New Topic</b> link on this page to post one."; + break; + case LOGIN_FAILED: $error_msg = "Login Failed. You have specified an incorrect/inactive username or invalid password, please go back and try again."; - break; + break; } } if(DEBUG) { - //$error_msg .= "<br>Line number: ".__LINE__."<br>In File: ".__FILE__; + if($line != "" && $file != "") + $error_msg .= "<br /><br /><u>DEBUG INFO</u></br /><br>Line: ".$line."<br />File: ".$file; } + $template->set_filenames(array("error_body" => "error_body.tpl")); $template->assign_vars(array("ERROR_MESSAGE" => $error_msg)); $template->pparse("error_body"); + include('includes/page_tail.'.$phpEx); + exit(); } - - - ?> |
