2001-03-10 11:07:52 +00:00
< ? php
2000-09-04 16:14:46 +00:00
2001-04-06 14:14:16 +00:00
function error_throttle () {
print " WARNING: submission rate exceeded. We detected too much data or events from your IP. Please wait a few minutes and try again. If you believe this is not justified, please contact us at <A HREF= \" mailto: " . variable_get ( site_mail , " root@localhost " ) . " \" > " . variable_get ( site_mail , " root@localhost " ) . " </A>. " ;
2001-01-26 13:38:46 +00:00
}
2000-05-28 09:23:56 +00:00
2000-11-20 10:27:35 +00:00
function error_httpd () {
2001-03-28 07:03:47 +00:00
global $REDIRECT_STATUS , $REDIRECT_URL , $HTTP_REFERER , $HTTP_USER_AGENT ;
2000-11-20 10:27:35 +00:00
switch ( $REDIRECT_STATUS ) {
case 500 :
$message = " 500 error - internal server error " ;
break ;
case 404 :
2000-12-14 14:20:06 +00:00
$message = " 404 error - ` $REDIRECT_URL ' not found " ;
2000-11-20 10:27:35 +00:00
break ;
case 403 :
$message = " 403 error - access denied - forbidden " ;
break ;
case 401 :
$message = " 401 error - authorization required " ;
break ;
2001-04-08 10:44:38 +00:00
case 400 :
2000-11-20 10:27:35 +00:00
$message = " 400 error - bad request " ;
break ;
default :
$message = " unknown error " ;
}
2000-12-16 08:39:01 +00:00
watchdog ( " error " , " message: ` $message ' - requested url: $REDIRECT_URL - referring url: $HTTP_REFERER - user agent: $HTTP_USER_AGENT " );
2001-01-26 13:38:46 +00:00
2000-11-20 10:27:35 +00:00
print " <PRE> \n " ;
print " <H1>Oops, an error occured!</H1> \n " ;
print " <B>Processed output:</B><BR> \n " ;
print " * $message <BR> \n " ;
2001-03-28 07:03:47 +00:00
print " * Return to the <A HREF= \" index.php \" >main page</A>. \n " ;
2000-11-20 10:27:35 +00:00
print " </PRE> \n " ;
}
2001-02-04 22:09:38 +00:00
include_once " includes/common.inc " ;
2000-11-20 10:27:35 +00:00
switch ( $op ) {
2001-04-06 14:14:16 +00:00
case " throttle " :
error_throttle ();
2000-11-20 10:27:35 +00:00
break ;
default :
error_httpd ();
}
2001-04-06 14:14:16 +00:00
?>