Dotclear

Changeset 1069:f06abe1a1e59


Ignore:
Timestamp:
12/15/12 11:52:52 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Public message now differs from admin message when DB connection fails, fixes #1306

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/prepend.php

    r962 r1069  
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    1212 
     13define('DC_CONTEXT_ADMIN',true); 
     14 
    1315require_once dirname(__FILE__).'/../prepend.php'; 
    1416 
     
    1921// HTTP/1.0 
    2022header("Pragma: no-cache"); 
    21  
    22 define('DC_CONTEXT_ADMIN',true); 
    2323 
    2424function dc_valid_fav($url) { 
  • inc/prepend.php

    r1011 r1069  
    162162} catch (Exception $e) { 
    163163     init_prepend_l10n(); 
    164      __error(__('Unable to connect to database') 
    165           ,$e->getCode() == 0 ? 
    166           sprintf(__('<p>This either means that the username and password information in '. 
    167           'your <strong>config.php</strong> file is incorrect or we can\'t contact '. 
    168           'the database server at "<em>%s</em>". This could mean your '. 
    169           'host\'s database server is down.</p> '. 
    170           '<ul><li>Are you sure you have the correct username and password?</li>'. 
    171           '<li>Are you sure that you have typed the correct hostname?</li>'. 
    172           '<li>Are you sure that the database server is running?</li></ul>'. 
    173           '<p>If you\'re unsure what these terms mean you should probably contact '. 
    174           'your host. If you still need help you can always visit the '. 
    175           '<a href="http://forum.dotclear.net/">Dotclear Support Forums</a>.</p>'). 
    176           (DC_DEBUG ? 
    177                __('The following error was encountered while trying to read the database:').'</p><ul><li>'.$e->getMessage().'</li></ul>' :  '') 
    178           ,(DC_DBHOST != '' ? DC_DBHOST : 'localhost') 
    179           ) 
    180           : '' 
    181           ,20); 
     164     if (!defined('DC_CONTEXT_ADMIN')) { 
     165          __error(__('Site temporarily unavailable'), 
     166               __('<p>We apologize for this temporary unavailability.<br />'. 
     167               'Thank you for your understanding.</p>'), 
     168               20); 
     169     } else { 
     170          __error(__('Unable to connect to database') 
     171               ,$e->getCode() == 0 ? 
     172               sprintf(__('<p>This either means that the username and password information in '. 
     173               'your <strong>config.php</strong> file is incorrect or we can\'t contact '. 
     174               'the database server at "<em>%s</em>". This could mean your '. 
     175               'host\'s database server is down.</p> '. 
     176               '<ul><li>Are you sure you have the correct username and password?</li>'. 
     177               '<li>Are you sure that you have typed the correct hostname?</li>'. 
     178               '<li>Are you sure that the database server is running?</li></ul>'. 
     179               '<p>If you\'re unsure what these terms mean you should probably contact '. 
     180               'your host. If you still need help you can always visit the '. 
     181               '<a href="http://forum.dotclear.net/">Dotclear Support Forums</a>.</p>'). 
     182               (DC_DEBUG ? 
     183                    __('The following error was encountered while trying to read the database:').'</p><ul><li>'.$e->getMessage().'</li></ul>' :  '') 
     184               ,(DC_DBHOST != '' ? DC_DBHOST : 'localhost') 
     185               ) 
     186               : '' 
     187               ,20); 
     188     } 
    182189} 
    183190 
  • locales/fr/main.po

    r1039 r1069  
    28652865msgstr "Impossible de lire le répertoire" 
    28662866 
     2867msgid "Site temporarily unavailable" 
     2868msgstr "Site temporairement indisponible" 
     2869 
     2870msgid "<p>We apologize for this temporary unavailability.<br />Thank you for your understanding.</p>" 
     2871msgstr "<p>Veuillez nous excuser pour cette indisponibilité momentanée.<br />Merci de votre compréhension.</p>" 
     2872 
    28672873msgid "Unable to connect to database" 
    28682874msgstr "Connexion à la base de données impossible" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map