Changeset 1614 in subversion
- Timestamp:
- Jul 28, 2008 7:45:35 AM (5 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 3 edited
-
index.php (modified) (1 diff)
-
program/include/rcube_config.php (modified) (3 diffs)
-
program/steps/error.inc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/index.php
r1562 r1614 51 51 ob_start(); 52 52 } 53 } 54 55 56 // check if config files had errors 57 if ($err_str = $RCMAIL->config->get_error()) { 58 raise_error(array( 59 'code' => 601, 60 'type' => 'php', 61 'message' => $err_str), false, true); 53 62 } 54 63 -
trunk/roundcubemail/program/include/rcube_config.php
r1558 r1614 28 28 { 29 29 private $prop = array(); 30 private $errors = array(); 30 31 31 32 … … 51 52 52 53 // load main config file 53 include_once(INSTALL_PATH . 'config/main.inc.php'); 54 $this->prop = (array)$rcmail_config; 54 if (include(INSTALL_PATH . 'config/main.inc.php')) 55 $this->prop = (array)$rcmail_config; 56 else 57 $this->errors[] = 'main.inc.php was not found.'; 55 58 56 59 // load database config 57 include_once(INSTALL_PATH . 'config/db.inc.php'); 58 $this->prop += (array)$rcmail_config; 60 if (include(INSTALL_PATH . 'config/db.inc.php')) 61 $this->prop += (array)$rcmail_config; 62 else 63 $this->errors[] = 'db.inc.php was not found.'; 59 64 60 65 // load host-specific configuration … … 223 228 return $domain; 224 229 } 230 231 232 /** 233 * Getter for error state 234 * 235 * @return mixed Error message on error, False if no errors 236 */ 237 public function get_error() 238 { 239 return empty($this->errors) ? false : join("\n", $this->errors); 240 } 225 241 226 242 -
trunk/roundcubemail/program/steps/error.inc
r1539 r1614 6 6 | | 7 7 | This file is part of the RoundCube Webmail client | 8 | Copyright (C) 2005-200 7, RoundCube Dev. - Switzerland |8 | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 22 22 23 23 // browser is not compatible with this application 24 if ($ERROR_CODE==409) 25 { 24 if ($ERROR_CODE==409) { 26 25 $user_agent = $GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT']; 27 26 $__error_title = 'Your browser does not suit the requirements for this application'; … … 40 39 $user_agent</p> 41 40 EOF; 42 }41 } 43 42 44 43 // authorization error 45 else if ($ERROR_CODE==401) 46 { 44 else if ($ERROR_CODE==401) { 47 45 $__error_title = "AUTHORIZATION FAILED"; 48 46 $__error_text = "Could not verify that you are authorized to access this service!<br />\n". 49 47 "Please contact your server-administrator."; 50 }48 } 51 49 52 50 // failed request (wrong step in URL) 53 else if ($ERROR_CODE==404) 54 { 51 else if ($ERROR_CODE==404) { 55 52 $__error_title = "REQUEST FAILED/FILE NOT FOUND"; 56 53 $request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); … … 62 59 http://$request_url</p> 63 60 EOF; 64 }61 } 65 62 66 63 // database connection error 67 else if ($ERROR_CODE==603) 68 { 64 else 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 71 else if ($ERROR_CODE==603) { 69 72 $__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 } 73 $__error_text = "Unable to connect to the database!<br />Please contact your server-administrator."; 74 } 75 75 76 76 // system error 77 else 78 { 77 else { 79 78 $__error_title = "SERVICE CURRENTLY NOT AVAILABLE!"; 80 79 $__error_text = "Please contact your server-administrator."; … … 84 83 else 85 84 $__error_text = sprintf('Error No. [0x%04X]', $ERROR_CODE); 86 }85 } 87 86 88 87 … … 98 97 99 98 100 if ($OUTPUT->template_exists('error')) 101 { 99 if ($OUTPUT && $OUTPUT->template_exists('error')) { 102 100 $OUTPUT->reset(); 103 101 $OUTPUT->send('error'); 104 }102 } 105 103 106 104 … … 124 122 EOF; 125 123 124 exit; 126 125 ?>
Note: See TracChangeset
for help on using the changeset viewer.
