*
* PHP version 5
*
- * Copyright © 2017 The Galette Team
+ * Copyright © 2017-2021 The Galette Team
*
- * This file is part of Galette (http://galette.eu).
+ * This file is part of Galette (https://galette.eu).
*
* Galette is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @package Galette
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2017 The Galette Team
+
+ * @copyright 2017-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
- * @link http://galette.eu
+ * @link https://galette.eu
*/
//change this *ONLY* for debug purposes!
* a single reverse proxy
*/
//define('GALETTE_X_FORWARDED_FOR_INDEX', 1);
+
+/*
+ * Uncomment to enable the installer page even if galette is already installed and up to date
+ * @see https://bugs.galette.eu/issues/1574
+ */
+//define('FORCE_INSTALLER', true);
if (!$installed && !$installer) {
header('location: ./installer.php');
die();
+} else if ($installed) {
+ include_once GALETTE_CONFIG_PATH . 'config.inc.php';
}
if (
include_once GALETTE_CONFIG_PATH . 'behavior.inc.php';
}
-if (isset($installer) && $installer !== true) {
- //If we're not working from installer
- include_once GALETTE_CONFIG_PATH . 'config.inc.php';
-}
-
use Analog\Analog;
use Analog\Handler;
use Analog\Handler\LevelName;
require_once GALETTE_ROOT . 'includes/functions.inc.php';
-if (!$installer and !defined('GALETTE_TESTS')) {
- //If we're not working from installer nor from tests
- include_once GALETTE_CONFIG_PATH . 'config.inc.php';
+//If we're not working from tests
+if ($installed && !defined('GALETTE_TESTS')) {
/**
* Database instantiation
echo _T("Galette has been successfully updated!");
}
?></p>
- <div id="errorbox"><?php echo _T("To secure the system, please delete the install directory"); ?></div>
<form action="<?php echo GALETTE_BASE_PATH; ?>" method="get">
<p id="btn_box">
<button type="submit"><?php echo _T("Homepage"); ?> <i class="fas fa-home"></i></button>
$install->reinitReport();
$config_file_ok = $install->writeConfFile();
+include_once GALETTE_CONFIG_PATH . 'config.inc.php';
+
$objects_ok = $install->initObjects($i18n, $zdb, new Login($zdb, $i18n));
?>
<h2><?php echo $install->getStepTitle(); ?></h2>
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr "الصفحة الرئيسية"
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr "La Galette s'ha actualitzat correctament!"
-#: ../install/steps/end.php:51
-#, fuzzy
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-"Per assegurar el sistema si us plau esborra el directori d'instal·lació"
-
#: ../install/steps/end.php:54
#, fuzzy
msgid "Homepage"
msgid "Galette has been successfully updated!"
msgstr "Galette wurde erfolgreich aktualisiert!"
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr "Um das System zu schützen, löschen Sie bitte das install Verzeichnis"
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr "Homepage"
msgid "Galette has been successfully updated!"
msgstr "Galette has been successfully updated!"
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr "To secure the system, please delete the install directory"
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr "Homepage"
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr "Galette a été mis à jour avec succès !"
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr "Pour sécuriser le système, veuillez supprimer le dossier « install »"
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr "Page d’accueil"
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr "Pagina d'acuèlh"
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr ""
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr ""
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr ""
msgid "Galette has been successfully updated!"
msgstr "Galette успішно оновлено!"
-#: ../install/steps/end.php:51
-msgid "To secure the system, please delete the install directory"
-msgstr "Щоб захистити систему, видаліть каталог установлення"
-
#: ../install/steps/end.php:54
msgid "Homepage"
msgstr "Домівка"
define('GALETTE_BASE_PATH', '../');
define('GALETTE_THEME_DIR', './themes/default/');
+$needs_update = false;
require_once '../includes/galette.inc.php';
session_start();
$session_name = 'galette_install_' . str_replace('.', '_', GALETTE_VERSION);
$session = &$_SESSION['galette'][$session_name];
+// don't display installer if not necessary
+$install_in_progress = isset($session[md5(GALETTE_ROOT)]);
+$force_installer = defined('FORCE_INSTALLER') && FORCE_INSTALLER;
+if (!$install_in_progress && !$force_installer && $installed && !$needs_update) {
+ http_response_code(404);
+ die();
+}
+
$app = new \Galette\Core\SlimApp();
require_once '../includes/dependencies.php';
$error_detected = array();
-/**
- * Initialize database constants to connect
- *
- * @param Install $install Installer
- *
- * @return void
- */
-function initDbConstants($install)
-{
- define('TYPE_DB', $install->getDbType());
- define('PREFIX_DB', $install->getTablesPrefix());
- define('USER_DB', $install->getDbUser());
- define('PWD_DB', $install->getDbPass());
- define('HOST_DB', $install->getDbHost());
- define('PORT_DB', $install->getDbPort());
- define('NAME_DB', $install->getDbName());
-}
-
if ($install->isStepPassed(GaletteInstall::STEP_TYPE)) {
define('GALETTE_LOGGER_CHECKED', true);
if (!$install->isEndStep()
&& ($install->postCheckDb() || $install->isDbCheckStep())
) {
- //if we have passed database configuration, define required constants
- initDbConstants($install);
-
- if ($install->postCheckDb()) {
- //while before check db, connection is not checked
- $zdb = new GaletteDb();
- }
+ //while before check db, connection is not checked
+ $zdb = new GaletteDb(array(
+ 'TYPE_DB' => $install->getDbType(),
+ 'HOST_DB' => $install->getDbHost(),
+ 'PORT_DB' => $install->getDbPort(),
+ 'USER_DB' => $install->getDbUser(),
+ 'PWD_DB' => $install->getDbPass(),
+ 'NAME_DB' => $install->getDbName()
+ ));
}
header('Content-Type: text/html; charset=UTF-8');