forked from e107inc/e107
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.php
89 lines (72 loc) · 1.36 KB
/
error.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/**
* e107 website system
*
* Copyright (C) 2008-2016 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* @file
* System error pages.
*/
define("ERR_PAGE_ACTIVE", 'error');
//We need minimal mod.
$_E107 = array(
'no_forceuserupdate',
'no_online',
'no_prunetmp',
);
define('e_TOKEN_DISABLE', true);
require_once("class2.php");
/**
* Class error_front.
*/
class error_front
{
/**
* @var
*/
private $errorNumber;
/**
* Constructor.
*/
public function __construct()
{
if(is_numeric(e_QUERY))
{
$this->errorNumber = intval(e_QUERY);
}
e107::getRender()->tablerender(LAN_ERROR,$this->renderErrorPage(), 'error_page_'.$this->errorNumber);
}
/**
* Renders the error page.
*/
public function renderErrorPage()
{
switch($this->errorNumber)
{
case 400:
$body = e107::getError()->render(400);
break;
case 401:
$body = e107::getError()->render(401);
break;
case 403:
$body = e107::getError()->render(403);
break;
case 404:
$body = e107::getError()->render(404);
break;
case 500:
$body = e107::getError()->render(500);
break;
default:
$body = e107::getError()->render('unknown');
break;
}
return $body;
}
}
require_once(HEADERF);
new error_front();
require_once(FOOTERF);