source: github/program/steps/error.inc @ bbeda81

HEADcourier-fixdev-browser-capabilitiespdorelease-0.6release-0.7release-0.8
Last change on this file since bbeda81 was bbeda81, checked in by alecpl <alec@…>, 5 years ago

#1485465: use common.css from skins instead of non-existent style.css

  • Property mode set to 100644
File size: 3.7 KB
Line 
1<?php
2
3/*
4 +-----------------------------------------------------------------------+
5 | program/steps/error.inc                                               |
6 |                                                                       |
7 | This file is part of the RoundCube Webmail client                     |
8 | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland                 |
9 | Licensed under the GNU GPL                                            |
10 |                                                                       |
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
24if ($ERROR_CODE==409) {
25  $user_agent = $GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT'];
26  $__error_title = 'Your browser does not suit the requirements for this application';
27  $__error_text = <<<EOF
28<i>Supported browsers:</i><br />
29&raquo; &nbsp;Netscape 7+<br />
30&raquo; &nbsp;Microsoft Internet Explorer 6+<br />
31&raquo; &nbsp;Mozilla Firefox 1.0+<br />
32&raquo; &nbsp;Opera 8.0+<br />
33&raquo; &nbsp;Safari 1.2+<br />
34<br />
35&raquo; &nbsp;JavaScript enabled<br />
36&raquo; &nbsp;Support for XMLHTTPRequest<br />
37
38<p><i>Your configuration:</i><br />
39$user_agent</p>
40EOF;
41}
42
43// authorization error
44else if ($ERROR_CODE==401) {
45  $__error_title = "AUTHORIZATION FAILED";
46  $__error_text  = "Could not verify that you are authorized to access this service!<br />\n".
47                   "Please contact your server-administrator.";
48}
49 
50// failed request (wrong step in URL)
51else if ($ERROR_CODE==404) {
52  $__error_title = "REQUEST FAILED/FILE NOT FOUND";
53  $request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
54  $__error_text  = <<<EOF
55The requested page was not found!<br />
56Please contact your server-administrator.
57
58<p><i>Failed request:</i><br />
59http://$request_url</p>
60EOF;
61}
62
63// database connection error
64else if ($ERROR_CODE==601)
65{
66  $__error_title = "CONFIGURATION ERROR";
67  $__error_text  =  nl2br($ERROR_MESSAGE) . "<br />Please read the INSTALL instructions!";
68}
69
70// database connection error
71else if ($ERROR_CODE==603) {
72  $__error_title = "DATABASE ERROR: CONNECTION FAILED!";
73  $__error_text  =  "Unable to connect to the database!<br />Please contact your server-administrator.";
74}
75
76// system error
77else {
78  $__error_title = "SERVICE CURRENTLY NOT AVAILABLE!";
79  $__error_text  = "Please contact your server-administrator.";
80
81  if (($CONFIG['debug_level'] & 4) && $ERROR_MESSAGE)
82    $__error_text = $ERROR_MESSAGE;
83  else
84    $__error_text = sprintf('Error No. [0x%04X]', $ERROR_CODE);
85}
86
87
88// compose page content
89
90$__page_content = <<<EOF
91<div>
92<h3 class="error-title">$__error_title</h3>
93<p class="error-text">$__error_text</p>
94</div>
95EOF;
96
97
98
99if ($OUTPUT && $OUTPUT->template_exists('error')) {
100  $OUTPUT->reset();
101  $OUTPUT->send('error');
102}
103
104$__skin = $CONFIG->skin ? $CONFIG->skin : 'default';
105
106// print system error page
107print <<<EOF
108<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
109<html xmlns="http://www.w3.org/1999/xhtml"><head>
110<title>RoundCube|Mail : ERROR $ERROR_CODE</title>
111<link rel="stylesheet" type="text/css" href="skins/$__skin/common.css" />
112</head>
113<body>
114
115<table border="0" cellsapcing="0" cellpadding="0" width="100%" height="80%"><tr><td align="center">
116
117$__page_content
118
119</td></tr></table>
120
121</body>
122</html>
123EOF;
124
125exit;
126?>
Note: See TracBrowser for help on using the repository browser.