From 7d631fb606b816c8bfefb448a5708e44e8c0e932 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 13 Jun 2001 21:20:52 +0000 Subject: - Simplified error handling such as 404 errors. --- error.php | 51 ++++++++------------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/error.php b/error.php index cf124b8b8..79304eaa2 100644 --- a/error.php +++ b/error.php @@ -1,50 +1,15 @@ ". variable_get(site_mail, "root@localhost") ."."; -} - -function error_httpd() { - global $REDIRECT_STATUS, $REDIRECT_URL, $HTTP_REFERER, $HTTP_USER_AGENT; - - switch($REDIRECT_STATUS) { - case 500: - $message = "500 error - internal server error"; - break; - case 404: - $message = "404 error - `$REDIRECT_URL' not found"; - break; - case 403: - $message = "403 error - access denied - forbidden"; - break; - case 401: - $message = "401 error - authorization required"; - break; - case 400: - $message = "400 error - bad request"; - break; - default: - $message = "unknown error"; - } - - watchdog("error", "message: `$message' - requested url: $REDIRECT_URL - referring url: $HTTP_REFERER - user agent: $HTTP_USER_AGENT"); +include_once "includes/common.inc"; - print "
\n";
-  print "

Oops, an error occured!

\n"; - print "Processed output:
\n"; - print " * $message
\n"; - print " * Return to the main page.\n"; - print "
\n"; -} +$errors = array(500 => "500 error - internal server error", + 404 => "404 error - `$REDIRECT_URL' not found", + 403 => "403 error - access denied - forbidden", + 401 => "401 error - authorization required", + 400 => "400 error - bad request"); -include_once "includes/common.inc"; +watchdog("error", $errors[$REDIRECT_STATUS]); -switch ($op) { - case "throttle": - error_throttle(); - break; - default: - error_httpd(); -} +header("Location: index.php"); ?> \ No newline at end of file -- cgit v1.2.3