From ac90cfcb82828e5ec42ffd1eeb25e1699b06571b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 20 Oct 2015 15:34:29 +0200 Subject: [PATCH] Improve installation system --- html/admin-noalyss.php | 5 + html/index.php | 10 +- html/{admin/setup.php => install.php} | 215 ++++++++++++---------- html/js/setup.js | 14 +- include/lib/class_database.php | 15 +- include/lib/config_file.php | 167 +++++++++-------- include/template/template_config_form.php | 22 ++- include/upgrade.inc.php | 2 +- 8 files changed, 253 insertions(+), 197 deletions(-) rename html/{admin/setup.php => install.php} (76%) diff --git a/html/admin-noalyss.php b/html/admin-noalyss.php index 45740f7bd..5f6ac73cc 100644 --- a/html/admin-noalyss.php +++ b/html/admin-noalyss.php @@ -31,5 +31,10 @@ if (file_exists("../include/config.inc.php") ) { define ('ALLOWED',1); require_once '../include/constant.php'; require_once NOALYSS_INCLUDE.'/admin_repo.inc.php'; +} else { + // Redirect to install file , if this file exists then + // we can't connect to anything + echo ' Connecting... '; + } ?> diff --git a/html/index.php b/html/index.php index dc0c14be6..f35ae1e2d 100644 --- a/html/index.php +++ b/html/index.php @@ -134,7 +134,7 @@ if ( ! file_exists('..'.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'config.inc.php')) { - header("Location: setup.php",true, 307); + header("Location: install.php",true, 307); exit(0); } @@ -209,7 +209,13 @@ $my_domain=""; require_once '../include/constant.php'; require_once '../include/config.inc.php'; require_once NOALYSS_INCLUDE.'/lib/ac_common.php'; - +if (file_exists("install.php")) { + /* + * This file shouldn't exist + */ + echo _("Le fichier install.php est encore présent, vous devez l'effacer avant d'utiliser NOALYSS"); + return; +} if ( strlen(domaine) > 0 ) { $my_domain="Domaine : ".domaine; diff --git a/html/admin/setup.php b/html/install.php similarity index 76% rename from html/admin/setup.php rename to html/install.php index fc2c906b5..1b5d08843 100644 --- a/html/admin/setup.php +++ b/html/install.php @@ -3,13 +3,14 @@ session_start(); ?> - Noalyss - Mise à jour + Noalyss - Install - + - + +