diff --git a/e107_languages/English/lan_error.php b/e107_languages/English/lan_error.php index 826d5b33b..81ba69893 100644 --- a/e107_languages/English/lan_error.php +++ b/e107_languages/English/lan_error.php @@ -4,9 +4,9 @@ | e107 website system - Language File. | | $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_error.php,v $ -| $Revision: 1.5 $ -| $Date: 2008-08-08 20:16:22 $ -| $Author: e107steved $ +| $Revision: 1.6 $ +| $Date: 2009-09-14 18:13:51 $ +| $Author: secretr $ +----------------------------------------------------------------------------+ */ define("PAGE_NAME", "Error"); @@ -59,5 +59,5 @@ define('LAN_ERROR_42', 'Additional error information: '); define('LAN_ERROR_43', 'Site unavailable temporarily'); define('LAN_ERROR_44', 'Site logo'); - -?> +define('LAN_ERROR_45', 'What can you do now?'); +?> \ No newline at end of file diff --git a/error.php b/error.php index ba25f2331..27fc7c7d4 100644 --- a/error.php +++ b/error.php @@ -11,57 +11,75 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/error.php,v $ -| $Revision: 1.10 $ -| $Date: 2009-08-28 15:30:24 $ -| $Author: marj_nl_fr $ +| $Revision: 1.11 $ +| $Date: 2009-09-14 18:13:51 $ +| $Author: secretr $ +----------------------------------------------------------------------------+ */ -define("ERR_PAGE_ACTIVE",'error'); +define("ERR_PAGE_ACTIVE", 'error'); + +//TODO - template(s) + +//We need minimal mod +$_E107 = array('no_forceuserupdate', 'no_online', 'no_prunetmp'); +require_once("class2.php"); include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); -require_once("class2.php"); +//start session if required +if(!session_id()) session_start(); -if (!defined('PAGE_NAME')) define('PAGE_NAME','Unknown page'); +if (!defined('PAGE_NAME')) define('PAGE_NAME','Error page'); $errorHeader = ''; $errorText = ''; $errorNumber = 999; -$errFrom = $_SERVER['HTTP_REFERER']; +$errFrom = isset($_SESSION['e107_http_referer']) ? $_SESSION['e107_http_referer'] : $_SERVER['HTTP_REFERER']; +$errReturnTo = isset($_SESSION['e107_error_return']) ? $_SESSION['e107_error_return'] : array(); +unset($_SESSION['e107_http_referer'], $_SESSION['e107_error_return']); + $errTo = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $errorQuery = htmlentities($_SERVER['QUERY_STRING']); $base_path = e_HTTP; -if (is_numeric(e_QUERY)) $errorNumber = e_QUERY; +if (is_numeric(e_QUERY)) $errorNumber = intval(e_QUERY); switch($errorNumber) { case 400 : $errorHeader = "HTTP/1.1 400 Bad Request"; - $errorText = "
".LAN_ERROR_37." ".LAN_ERROR_35."

".LAN_ERROR_36."

".LAN_ERROR_3."
+ $errorText = "

".LAN_ERROR_37." ".LAN_ERROR_35."

".LAN_ERROR_36."

".LAN_ERROR_3."

".LAN_ERROR_2."
".LAN_ERROR_20."
"; break; case 401: $errorHeader = "HTTP/1.1 401 Unauthorized"; - $errorText = "
".LAN_ERROR_37." ".LAN_ERROR_1."

".LAN_ERROR_2."

".LAN_ERROR_3."
+ $errorText = "

".LAN_ERROR_37." ".LAN_ERROR_1."

".LAN_ERROR_2."

".LAN_ERROR_3."

".LAN_ERROR_2."
".LAN_ERROR_20."
"; break; case 403: $errorHeader = "HTTP/1.1 403 Forbidden"; - $errorText = "
".LAN_ERROR_37." ".LAN_ERROR_4."

".LAN_ERROR_5."

".LAN_ERROR_6."
+ $errorText = "

".LAN_ERROR_37." ".LAN_ERROR_4."

".LAN_ERROR_5."

".LAN_ERROR_6."

".LAN_ERROR_2."
".LAN_ERROR_20."
"; break; case 404: $errorHeader = "HTTP/1.1 404 Not Found"; - $errorText = "

".LAN_ERROR_37." ".LAN_ERROR_7."


".LAN_ERROR_21."

".LAN_ERROR_23."{$errTo}".LAN_ERROR_24."

"; + $errorText = "

".LAN_ERROR_37." ".LAN_ERROR_7."

".LAN_ERROR_21.'
'.LAN_ERROR_9."

"; + if (strlen($errFrom)) $errorText .= LAN_ERROR_23." {$errFrom} ".LAN_ERROR_24." -- ".LAN_ERROR_19."

"; + //.LAN_ERROR_23."{$errTo}".LAN_ERROR_24."

" ??? - if (strlen($errFrom)) $text .= LAN_ERROR_9." ( {$errFrom} ) -- ".LAN_ERROR_19."
"; - - - $errorText .= "
".LAN_ERROR_20."
"; + $errorText .= "

".LAN_ERROR_45."

"; + if($errReturnTo) + { + foreach ($errReturnTo as $url => $label) + { + $errorText .= "".$label."
"; + } + $errorText .= '
'; + } + $errorText .= "".LAN_ERROR_20."
"; $errorText .= "".LAN_ERROR_22.""; break; case 500: $errorHeader = "HTTP/1.1 500 Internal Server Error"; - $errorText = "
".LAN_ERROR_37." ".LAN_ERROR_10."

".LAN_ERROR_11."

".LAN_ERROR_12."
+ $errorText = "

".LAN_ERROR_37." ".LAN_ERROR_10."

".LAN_ERROR_11."

".LAN_ERROR_12."

".LAN_ERROR_2."
".LAN_ERROR_20."
"; break; case 999: @@ -80,7 +98,7 @@ switch($errorNumber) break; default : - $errorText = "
".LAN_ERROR_13." (".$errorQuery.")

".LAN_ERROR_14."

".LAN_ERROR_15."
+ $errorText = "

".LAN_ERROR_13." (".$errorQuery.")

".LAN_ERROR_14."

".LAN_ERROR_15."

".LAN_ERROR_20."
"; // default: