commit | author | age
|
4e17e6
|
1 |
<?php |
T |
2 |
|
|
3 |
/* |
|
4 |
+-----------------------------------------------------------------------+ |
|
5 |
| program/steps/error.inc | |
|
6 |
| | |
|
7 |
| This file is part of the RoundCube Webmail client | |
5349b7
|
8 |
| Copyright (C) 2005-2007, RoundCube Dev. - Switzerland | |
30233b
|
9 |
| Licensed under the GNU GPL | |
4e17e6
|
10 |
| | |
T |
11 |
| PURPOSE: | |
|
12 |
| Display error message page | |
|
13 |
| | |
|
14 |
+-----------------------------------------------------------------------+ |
|
15 |
| Author: Thomas Bruederli <roundcube@gmail.com> | |
|
16 |
+-----------------------------------------------------------------------+ |
|
17 |
|
|
18 |
$Id$ |
|
19 |
|
|
20 |
*/ |
|
21 |
|
|
22 |
|
|
23 |
// browser is not compatible with this application |
|
24 |
if ($ERROR_CODE==409) |
|
25 |
{ |
|
26 |
$user_agent = $GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT']; |
|
27 |
$__error_title = 'Your browser does not suit the requirements for this application'; |
|
28 |
$__error_text = <<<EOF |
|
29 |
<i>Supported browsers:</i><br /> |
|
30 |
» Netscape 7+<br /> |
|
31 |
» Microsoft Internet Explorer 6+<br /> |
|
32 |
» Mozilla Firefox 1.0+<br /> |
|
33 |
» Opera 8.0+<br /> |
|
34 |
» Safari 1.2+<br /> |
|
35 |
<br /> |
|
36 |
» JavaScript enabled<br /> |
a95e0e
|
37 |
» Support for XMLHTTPRequest<br /> |
4e17e6
|
38 |
|
T |
39 |
<p><i>Your configuration:</i><br /> |
|
40 |
$user_agent</p> |
|
41 |
EOF; |
|
42 |
} |
|
43 |
|
|
44 |
// authorization error |
|
45 |
else if ($ERROR_CODE==401) |
|
46 |
{ |
|
47 |
$__error_title = "AUTHORIZATION FAILED"; |
|
48 |
$__error_text = "Could not verify that you are authorized to access this service!<br />\n". |
|
49 |
"Please contact your server-administrator."; |
|
50 |
} |
|
51 |
|
|
52 |
// failed request (wrong step in URL) |
|
53 |
else if ($ERROR_CODE==404) |
|
54 |
{ |
|
55 |
$__error_title = "REQUEST FAILED/FILE NOT FOUND"; |
89406f
|
56 |
$request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); |
4e17e6
|
57 |
$__error_text = <<<EOF |
T |
58 |
The requested page was not found!<br /> |
|
59 |
Please contact your server-administrator. |
|
60 |
|
|
61 |
<p><i>Failed request:</i><br /> |
|
62 |
http://$request_url</p> |
|
63 |
EOF; |
|
64 |
} |
|
65 |
|
8b0fff
|
66 |
// database connection error |
f11541
|
67 |
else if ($ERROR_CODE==603) |
8b0fff
|
68 |
{ |
S |
69 |
$__error_title = "DATABASE ERROR: CONNECTION FAILED!"; |
|
70 |
$__error_text = <<<EOF |
|
71 |
Unable to connect to the database!<br /> |
|
72 |
Please contact your server-administrator. |
|
73 |
EOF; |
|
74 |
} |
4e17e6
|
75 |
|
T |
76 |
// system error |
|
77 |
else |
|
78 |
{ |
|
79 |
$__error_title = "SERVICE CURRENTLY NOT AVAILABLE!"; |
|
80 |
$__error_text = "Please contact your server-administrator."; |
e170b4
|
81 |
|
4e17e6
|
82 |
if (($CONFIG['debug_level'] & 4) && $ERROR_MESSAGE) |
T |
83 |
$__error_text = $ERROR_MESSAGE; |
|
84 |
else |
c45eb5
|
85 |
$__error_text = sprintf('Error No. [0x%04X]', $ERROR_CODE); |
4e17e6
|
86 |
} |
T |
87 |
|
|
88 |
|
|
89 |
// compose page content |
|
90 |
|
|
91 |
$__page_content = <<<EOF |
|
92 |
<div> |
|
93 |
<h3 class="error-title">$__error_title</h3> |
|
94 |
<p class="error-text">$__error_text</p> |
|
95 |
</div> |
|
96 |
EOF; |
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
if (template_exists('error')) |
|
101 |
{ |
4c6b66
|
102 |
$OUTPUT->reset(); |
47124c
|
103 |
$OUTPUT->send('error'); |
4e17e6
|
104 |
} |
T |
105 |
|
|
106 |
|
|
107 |
// print system error page |
|
108 |
print <<<EOF |
|
109 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
110 |
<html xmlns="http://www.w3.org/1999/xhtml"><head> |
|
111 |
<title>RoundCube|Mail : ERROR $ERROR_CODE</title> |
|
112 |
<link rel="stylesheet" type="text/css" href="program/style.css" /> |
|
113 |
</head> |
|
114 |
<body> |
|
115 |
|
|
116 |
<table border="0" cellsapcing="0" cellpadding="0" width="100%" height="80%"><tr><td align="center"> |
|
117 |
|
|
118 |
$__page_content |
|
119 |
|
|
120 |
</td></tr></table> |
|
121 |
|
|
122 |
</body> |
|
123 |
</html> |
|
124 |
EOF; |
|
125 |
|
5349b7
|
126 |
?> |