From: Jerome Jutteau Date: Sun, 3 Jul 2022 14:38:09 +0000 (+0200) Subject: [BUGFIX] Print nice error when install.php is missing and we need it. X-Git-Tag: 4.5.0~21 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/129402901986004b50bf8bb338f681b0a0983800?hp=e7ca00035309ca757f2be9dddf37b0f66d66c2b6 [BUGFIX] Print nice error when install.php is missing and we need it. Also show header when printing this type of fatal error Signed-off-by: Jerome Jutteau --- diff --git a/index.php b/index.php index 9f1b0c7..1a8b2bd 100644 --- a/index.php +++ b/index.php @@ -27,6 +27,7 @@ require(JIRAFEAU_ROOT . 'lib/lang.php'); check_errors($cfg); if (has_error()) { + require(JIRAFEAU_ROOT . 'lib/template/header.php'); show_errors(); require(JIRAFEAU_ROOT . 'lib/template/footer.php'); exit; diff --git a/lib/functions.php b/lib/functions.php index 4dcf5de..95a5595 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -579,13 +579,15 @@ function show_errors() function check_errors($cfg) { - if (file_exists(JIRAFEAU_ROOT . 'install.php') - && !($cfg['installation_done'] === true)) { - header('Location: install.php'); - exit; + if (!($cfg['installation_done'] === true)) { + if (file_exists(JIRAFEAU_ROOT . 'install.php')) { + header('Location: install.php'); + exit; + } else { + add_error(t('INSTALL_FILE_NOT_FOUND_TITLE'), t('INSTALL_FILE_NOT_FOUND_DESC')); + } } - /* Checking for errors. */ if (!is_writable(VAR_FILES)) { add_error(t('FILE_DIR_W'), VAR_FILES); } diff --git a/lib/locales/ar.json b/lib/locales/ar.json index 2e68b08..8716a87 100644 --- a/lib/locales/ar.json +++ b/lib/locales/ar.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "حجم البيانات", diff --git a/lib/locales/be.json b/lib/locales/be.json index 2893d8a..4c7218a 100644 --- a/lib/locales/be.json +++ b/lib/locales/be.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/bn_IN.json b/lib/locales/bn_IN.json index 4c4d1dd..da6831a 100644 --- a/lib/locales/bn_IN.json +++ b/lib/locales/bn_IN.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/bo.json b/lib/locales/bo.json index 772777a..58a6845 100644 --- a/lib/locales/bo.json +++ b/lib/locales/bo.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/ca.json b/lib/locales/ca.json index 1f70ecb..fdcaa45 100644 --- a/lib/locales/ca.json +++ b/lib/locales/ca.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Una quincena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/cs.json b/lib/locales/cs.json index 737980b..2803a33 100644 --- a/lib/locales/cs.json +++ b/lib/locales/cs.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/da.json b/lib/locales/da.json index c420396..f1e69ac 100644 --- a/lib/locales/da.json +++ b/lib/locales/da.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/de.json b/lib/locales/de.json index 1db7f7b..0236960 100644 --- a/lib/locales/de.json +++ b/lib/locales/de.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Zwei Wochen", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Datengröße", diff --git a/lib/locales/el.json b/lib/locales/el.json index 84937c3..46cb17b 100644 --- a/lib/locales/el.json +++ b/lib/locales/el.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/en.json b/lib/locales/en.json index 817c1f4..b3de22c 100644 --- a/lib/locales/en.json +++ b/lib/locales/en.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "Installation file not found", + "INSTALL_FILE_NOT_FOUND_DESC": "Installation is not complete and install.php file does not seem to exist", "REPORTING_AN_ISSUE": "Reporting an issue", "SIZE_DATA": "Data size", "INCOMPATIBLE_OPTIONS_W": "The following configuration options are incompatible:", diff --git a/lib/locales/es.json b/lib/locales/es.json index b7cff2f..cbf0333 100644 --- a/lib/locales/es.json +++ b/lib/locales/es.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Una quincena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/et.json b/lib/locales/et.json index b62d93f..6bca483 100644 --- a/lib/locales/et.json +++ b/lib/locales/et.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/fi.json b/lib/locales/fi.json index 960c417..5bd1613 100644 --- a/lib/locales/fi.json +++ b/lib/locales/fi.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/fr.json b/lib/locales/fr.json index 73aab89..0e7d55a 100644 --- a/lib/locales/fr.json +++ b/lib/locales/fr.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "Fichier d'installation non-trouvé", + "INSTALL_FILE_NOT_FOUND_DESC": "L'installation est incomplète et le ficher install.php est introuvable", "2_W": "Deux semaines", "REPORTING_AN_ISSUE": "Rapporter un bogue", "SIZE_DATA": "Volume de données", diff --git a/lib/locales/he.json b/lib/locales/he.json index 8f711a9..45ee211 100644 --- a/lib/locales/he.json +++ b/lib/locales/he.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "גודל הנתונים", diff --git a/lib/locales/hi.json b/lib/locales/hi.json index 0831b20..1c8538f 100644 --- a/lib/locales/hi.json +++ b/lib/locales/hi.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/hr.json b/lib/locales/hr.json index bf4a83b..a5a6f53 100644 --- a/lib/locales/hr.json +++ b/lib/locales/hr.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Veličina podataka", diff --git a/lib/locales/hu.json b/lib/locales/hu.json index d45f078..129c3e5 100644 --- a/lib/locales/hu.json +++ b/lib/locales/hu.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/id.json b/lib/locales/id.json index 772777a..58a6845 100644 --- a/lib/locales/id.json +++ b/lib/locales/id.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/it.json b/lib/locales/it.json index 81e662b..30dc9fe 100644 --- a/lib/locales/it.json +++ b/lib/locales/it.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Due settimane", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Dimensione dei dati", diff --git a/lib/locales/ja.json b/lib/locales/ja.json index 3f0cd79..cf36cc7 100644 --- a/lib/locales/ja.json +++ b/lib/locales/ja.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/ko.json b/lib/locales/ko.json index 0831b20..1c8538f 100644 --- a/lib/locales/ko.json +++ b/lib/locales/ko.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/ku.json b/lib/locales/ku.json index b62d93f..6bca483 100644 --- a/lib/locales/ku.json +++ b/lib/locales/ku.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/la.json b/lib/locales/la.json index 95e226b..846f564 100644 --- a/lib/locales/la.json +++ b/lib/locales/la.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/mfe.json b/lib/locales/mfe.json index b62d93f..6bca483 100644 --- a/lib/locales/mfe.json +++ b/lib/locales/mfe.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/ms.json b/lib/locales/ms.json index 772777a..58a6845 100644 --- a/lib/locales/ms.json +++ b/lib/locales/ms.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/nb_NO.json b/lib/locales/nb_NO.json index d05dd01..ecc9e9e 100644 --- a/lib/locales/nb_NO.json +++ b/lib/locales/nb_NO.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "To uker", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Datastørrelse", diff --git a/lib/locales/nl.json b/lib/locales/nl.json index 21aaf26..75e6229 100644 --- a/lib/locales/nl.json +++ b/lib/locales/nl.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Twee weken", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/pl.json b/lib/locales/pl.json index d5a2742..eea531b 100644 --- a/lib/locales/pl.json +++ b/lib/locales/pl.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Rozmiar danych", diff --git a/lib/locales/ps.json b/lib/locales/ps.json index b62d93f..6bca483 100644 --- a/lib/locales/ps.json +++ b/lib/locales/ps.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/pt.json b/lib/locales/pt.json index bcb7a49..0d0cc74 100644 --- a/lib/locales/pt.json +++ b/lib/locales/pt.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Uma quinzena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Tamanho dos dados", diff --git a/lib/locales/pt_BR.json b/lib/locales/pt_BR.json index fabff5a..5923adc 100644 --- a/lib/locales/pt_BR.json +++ b/lib/locales/pt_BR.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Uma quinzena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/ro.json b/lib/locales/ro.json index 3edb71c..f3d9841 100644 --- a/lib/locales/ro.json +++ b/lib/locales/ro.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Mărime date", diff --git a/lib/locales/ru.json b/lib/locales/ru.json index 8087478..aba71f5 100644 --- a/lib/locales/ru.json +++ b/lib/locales/ru.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/sh.json b/lib/locales/sh.json index b62d93f..6bca483 100644 --- a/lib/locales/sh.json +++ b/lib/locales/sh.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/sk.json b/lib/locales/sk.json index c38d159..bbf21ea 100644 --- a/lib/locales/sk.json +++ b/lib/locales/sk.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/sl.json b/lib/locales/sl.json index b62d93f..6bca483 100644 --- a/lib/locales/sl.json +++ b/lib/locales/sl.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/sq.json b/lib/locales/sq.json index b62d93f..6bca483 100644 --- a/lib/locales/sq.json +++ b/lib/locales/sq.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/sr.json b/lib/locales/sr.json index b22674a..2149291 100644 --- a/lib/locales/sr.json +++ b/lib/locales/sr.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/sv.json b/lib/locales/sv.json index 6d842da..aada5f9 100644 --- a/lib/locales/sv.json +++ b/lib/locales/sv.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "Två veckor", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Data storlek", diff --git a/lib/locales/ta.json b/lib/locales/ta.json index 74f3a49..16ee6fc 100644 --- a/lib/locales/ta.json +++ b/lib/locales/ta.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/template.json b/lib/locales/template.json index 4ceb498..5a55190 100644 --- a/lib/locales/template.json +++ b/lib/locales/template.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/th.json b/lib/locales/th.json index b62d93f..6bca483 100644 --- a/lib/locales/th.json +++ b/lib/locales/th.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/tr.json b/lib/locales/tr.json index ef253a2..0562f4f 100644 --- a/lib/locales/tr.json +++ b/lib/locales/tr.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "İki hafta", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Veri boyutu", diff --git a/lib/locales/uk.json b/lib/locales/uk.json index c90655e..a933434 100644 --- a/lib/locales/uk.json +++ b/lib/locales/uk.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Розмір даних", diff --git a/lib/locales/vi.json b/lib/locales/vi.json index 3f0cd79..cf36cc7 100644 --- a/lib/locales/vi.json +++ b/lib/locales/vi.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/zh.json b/lib/locales/zh.json index abb9ee6..9696a4f 100644 --- a/lib/locales/zh.json +++ b/lib/locales/zh.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", diff --git a/lib/locales/zh_TW.json b/lib/locales/zh_TW.json index 20b3ab4..b243155 100644 --- a/lib/locales/zh_TW.json +++ b/lib/locales/zh_TW.json @@ -1,4 +1,6 @@ { + "INSTALL_FILE_NOT_FOUND_TITLE": "", + "INSTALL_FILE_NOT_FOUND_DESC": "", "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "",