mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
error page: handle better 404, minimal mod, LAN fixes
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
| e107 website system - Language File.
|
| e107 website system - Language File.
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_error.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_error.php,v $
|
||||||
| $Revision: 1.5 $
|
| $Revision: 1.6 $
|
||||||
| $Date: 2008-08-08 20:16:22 $
|
| $Date: 2009-09-14 18:13:51 $
|
||||||
| $Author: e107steved $
|
| $Author: secretr $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
define("PAGE_NAME", "Error");
|
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_43', 'Site unavailable temporarily');
|
||||||
define('LAN_ERROR_44', 'Site logo');
|
define('LAN_ERROR_44', 'Site logo');
|
||||||
|
|
||||||
|
define('LAN_ERROR_45', 'What can you do now?');
|
||||||
?>
|
?>
|
54
error.php
54
error.php
@@ -11,57 +11,75 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/error.php,v $
|
| $Source: /cvs_backup/e107_0.8/error.php,v $
|
||||||
| $Revision: 1.10 $
|
| $Revision: 1.11 $
|
||||||
| $Date: 2009-08-28 15:30:24 $
|
| $Date: 2009-09-14 18:13:51 $
|
||||||
| $Author: marj_nl_fr $
|
| $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);
|
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 = '';
|
$errorHeader = '';
|
||||||
$errorText = '';
|
$errorText = '';
|
||||||
$errorNumber = 999;
|
$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'];
|
$errTo = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||||
$errorQuery = htmlentities($_SERVER['QUERY_STRING']);
|
$errorQuery = htmlentities($_SERVER['QUERY_STRING']);
|
||||||
$base_path = e_HTTP;
|
$base_path = e_HTTP;
|
||||||
if (is_numeric(e_QUERY)) $errorNumber = e_QUERY;
|
if (is_numeric(e_QUERY)) $errorNumber = intval(e_QUERY);
|
||||||
|
|
||||||
switch($errorNumber)
|
switch($errorNumber)
|
||||||
{
|
{
|
||||||
case 400 :
|
case 400 :
|
||||||
$errorHeader = "HTTP/1.1 400 Bad Request";
|
$errorHeader = "HTTP/1.1 400 Bad Request";
|
||||||
$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_35."</div><br /><div class='installh'>".LAN_ERROR_36."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
|
$errorText = "<h1><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_35."</h1><div class='installh'>".LAN_ERROR_36."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
|
||||||
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
||||||
break;
|
break;
|
||||||
case 401:
|
case 401:
|
||||||
$errorHeader = "HTTP/1.1 401 Unauthorized";
|
$errorHeader = "HTTP/1.1 401 Unauthorized";
|
||||||
$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_1."</div><br /><div class='installh'>".LAN_ERROR_2."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
|
$errorText = "<h1><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_1."</h1><div class='installh'>".LAN_ERROR_2."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
|
||||||
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
||||||
break;
|
break;
|
||||||
case 403:
|
case 403:
|
||||||
$errorHeader = "HTTP/1.1 403 Forbidden";
|
$errorHeader = "HTTP/1.1 403 Forbidden";
|
||||||
$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_4."</div><br /><div class='installh'>".LAN_ERROR_5."</div><br /><div class='smalltext'>".LAN_ERROR_6."</div>
|
$errorText = "<h1><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_4."</h1><div class='installh'>".LAN_ERROR_5."</div><br /><div class='smalltext'>".LAN_ERROR_6."</div>
|
||||||
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
||||||
break;
|
break;
|
||||||
case 404:
|
case 404:
|
||||||
$errorHeader = "HTTP/1.1 404 Not Found";
|
$errorHeader = "HTTP/1.1 404 Not Found";
|
||||||
$errorText = "<h3><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_7."</h3><br />".LAN_ERROR_21."<br /><br />".LAN_ERROR_23."<b>{$errTo}</b>".LAN_ERROR_24."<br /><br />";
|
$errorText = "<h1><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_7."</h1>".LAN_ERROR_21.'<br />'.LAN_ERROR_9."<br /><br />";
|
||||||
|
if (strlen($errFrom)) $errorText .= LAN_ERROR_23." <a href='{$errFrom}' rel='external'>{$errFrom}</a> ".LAN_ERROR_24." -- ".LAN_ERROR_19."<br /><br />";
|
||||||
|
//.LAN_ERROR_23."<b>{$errTo}</b>".LAN_ERROR_24."<br /><br />" ???
|
||||||
|
|
||||||
if (strlen($errFrom)) $text .= LAN_ERROR_9." ( <a href='{$errFrom}' rel='external'>{$errFrom}</a> ) -- ".LAN_ERROR_19."<br />";
|
$errorText .= "<h3>".LAN_ERROR_45."</h3>";
|
||||||
|
if($errReturnTo)
|
||||||
|
{
|
||||||
$errorText .= "<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a><br />";
|
foreach ($errReturnTo as $url => $label)
|
||||||
|
{
|
||||||
|
$errorText .= "<a href='{$url}'>".$label."</a><br />";
|
||||||
|
}
|
||||||
|
$errorText .= '<br />';
|
||||||
|
}
|
||||||
|
$errorText .= "<a href='{$base_path}index.php'>".LAN_ERROR_20."</a><br />";
|
||||||
$errorText .= "<a href='{$base_path}search.php'>".LAN_ERROR_22."</a>";
|
$errorText .= "<a href='{$base_path}search.php'>".LAN_ERROR_22."</a>";
|
||||||
break;
|
break;
|
||||||
case 500:
|
case 500:
|
||||||
$errorHeader = "HTTP/1.1 500 Internal Server Error";
|
$errorHeader = "HTTP/1.1 500 Internal Server Error";
|
||||||
$errorText = "<div class='installe'><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_10."</div><br /><div class='installh'>".LAN_ERROR_11."</div><br /><div class='smalltext'>".LAN_ERROR_12."</div>
|
$errorText = "<h1><img src='".e_IMAGE_ABS."generic/warning.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_10."</h1><div class='installh'>".LAN_ERROR_11."</div><br /><div class='smalltext'>".LAN_ERROR_12."</div>
|
||||||
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
<br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
||||||
break;
|
break;
|
||||||
case 999:
|
case 999:
|
||||||
@@ -80,7 +98,7 @@ switch($errorNumber)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
$errorText = "<div class='installe'>".LAN_ERROR_13." (".$errorQuery.")</div><br /><div class='installh'>".LAN_ERROR_14."</div><br /><div class='smalltext'>".LAN_ERROR_15."</div>
|
$errorText = "<h1>".LAN_ERROR_13." (".$errorQuery.")</h1><div class='installh'>".LAN_ERROR_14."</div><br /><div class='smalltext'>".LAN_ERROR_15."</div>
|
||||||
<br /><div class='installh'><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
<br /><div class='installh'><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
|
||||||
|
|
||||||
// default:
|
// default:
|
||||||
|
Reference in New Issue
Block a user