4 +-----------------------------------------------------------------------+
5 | program/steps/error.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Display error message page |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: error.inc 2547 2009-05-26 16:54:55Z alec $
23 // browser is not compatible with this application
24 if ($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 » Netscape 7+<br />
30 » Microsoft Internet Explorer 6+<br />
31 » Mozilla Firefox 1.0+<br />
32 » Opera 8.0+<br />
33 » Safari 1.2+<br />
35 » JavaScript enabled<br />
36 » Support for XMLHTTPRequest<br />
38 <p><i>Your configuration:</i><br />
43 // authorization error
44 else 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.";
50 // failed request (wrong step in URL)
51 else 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
55 The requested page was not found!<br />
56 Please contact your server-administrator.
58 <p><i>Failed request:</i><br />
59 http://$request_url</p>
63 // database connection error
64 else if ($ERROR_CODE==601)
66 $__error_title = "CONFIGURATION ERROR";
67 $__error_text = nl2br($ERROR_MESSAGE) . "<br />Please read the INSTALL instructions!";
70 // database connection error
71 else 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.";
78 $__error_title = "SERVICE CURRENTLY NOT AVAILABLE!";
79 $__error_text = "Please contact your server-administrator.";
81 if (($CONFIG['debug_level'] & 4) && $ERROR_MESSAGE)
82 $__error_text = $ERROR_MESSAGE;
84 $__error_text = sprintf('Error No. [%s]', $ERROR_CODE);
89 if ($OUTPUT && ($OUTPUT instanceof rcube_json_output)) {
90 header("HTTP/1.0 $ERROR_CODE $__error_title");
94 // compose page content
95 $__page_content = <<<EOF
97 <h3 class="error-title">$__error_title</h3>
98 <p class="error-text">$__error_text</p>
102 if ($OUTPUT && $OUTPUT->template_exists('error')) {
104 $OUTPUT->send('error');
107 $__skin = $CONFIG->skin ? $CONFIG->skin : 'default';
109 // print system error page
111 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
112 <html xmlns="http://www.w3.org/1999/xhtml"><head>
113 <title>RoundCube|Mail : ERROR $ERROR_CODE</title>
114 <link rel="stylesheet" type="text/css" href="skins/$__skin/common.css" />
118 <table border="0" cellsapcing="0" cellpadding="0" width="100%" height="80%"><tr><td align="center">