Ignore:
Timestamp:
Jul 28, 2008 7:45:35 AM (5 years ago)
Author:
thomasb
Message:

Show appropriate error message if config files are missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/error.inc

    r1539 r1614  
    66 |                                                                       | 
    77 | This file is part of the RoundCube Webmail client                     | 
    8  | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 | 
     8 | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland                 | 
    99 | Licensed under the GNU GPL                                            | 
    1010 |                                                                       | 
     
    2222 
    2323// browser is not compatible with this application 
    24 if ($ERROR_CODE==409) 
    25   { 
     24if ($ERROR_CODE==409) { 
    2625  $user_agent = $GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT']; 
    2726  $__error_title = 'Your browser does not suit the requirements for this application'; 
     
    4039$user_agent</p> 
    4140EOF; 
    42   } 
     41} 
    4342 
    4443// authorization error 
    45 else if ($ERROR_CODE==401) 
    46   { 
     44else if ($ERROR_CODE==401) { 
    4745  $__error_title = "AUTHORIZATION FAILED"; 
    4846  $__error_text  = "Could not verify that you are authorized to access this service!<br />\n". 
    4947                   "Please contact your server-administrator."; 
    50   } 
     48} 
    5149   
    5250// failed request (wrong step in URL) 
    53 else if ($ERROR_CODE==404) 
    54   { 
     51else if ($ERROR_CODE==404) { 
    5552  $__error_title = "REQUEST FAILED/FILE NOT FOUND"; 
    5653  $request_url = htmlentities($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); 
     
    6259http://$request_url</p> 
    6360EOF; 
    64   } 
     61} 
    6562 
    6663// database connection error 
    67 else if ($ERROR_CODE==603) 
    68   { 
     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) { 
    6972  $__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} 
    7575 
    7676// system error 
    77 else 
    78   { 
     77else { 
    7978  $__error_title = "SERVICE CURRENTLY NOT AVAILABLE!"; 
    8079  $__error_text  = "Please contact your server-administrator."; 
     
    8483  else 
    8584    $__error_text = sprintf('Error No. [0x%04X]', $ERROR_CODE); 
    86   } 
     85} 
    8786 
    8887 
     
    9897 
    9998 
    100 if ($OUTPUT->template_exists('error')) 
    101   { 
     99if ($OUTPUT && $OUTPUT->template_exists('error')) { 
    102100  $OUTPUT->reset(); 
    103101  $OUTPUT->send('error'); 
    104   } 
     102} 
    105103 
    106104 
     
    124122EOF; 
    125123 
     124exit; 
    126125?> 
Note: See TracChangeset for help on using the changeset viewer.