From d7c1249b6b54df65d4b9f6ff45ee567b2cb62433 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 00:06:13 +0200 Subject: [PATCH] Setup adjust --- code/web/private_php/setup/config/config.php | 2 +- code/web/public_php/ams/index.php | 9 ++- code/web/public_php/setup/database.php | 64 +++++++++++--------- code/web/public_php/setup/version.php | 2 +- 4 files changed, 47 insertions(+), 30 deletions(-) diff --git a/code/web/private_php/setup/config/config.php b/code/web/private_php/setup/config/config.php index 0db6727a2..d0cb88faf 100644 --- a/code/web/private_php/setup/config/config.php +++ b/code/web/private_php/setup/config/config.php @@ -137,7 +137,7 @@ $NEL_SETUP_PASSWORD = '%nelSetupPassword%'; $NEL_DOMAIN_NAME = '%nelDomainName%'; // Currently configured setup version -$NEL_SETUP_VERSION_CONFIGURED = '%nelSetupVersion%'; +$NEL_SETUP_VERSION_CONFIGURED = (int)'%nelSetupVersion%'; // Get installed version require_once('setup/version.php'); diff --git a/code/web/public_php/ams/index.php b/code/web/public_php/ams/index.php index de2e93235..43ef1aeb9 100644 --- a/code/web/public_php/ams/index.php +++ b/code/web/public_php/ams/index.php @@ -20,11 +20,18 @@ try { if (!file_exists('../role_support')) { header("Cache-Control: max-age=1"); - header('Location: ../setup', true, 303); + header('Location: ../setup?reason=no_role_support&from=ams', true, 303); throw new SystemExit(); } require( '../config.php' ); + +if ($NEL_SETUP_VERSION_CONFIGURED < $NEL_SETUP_VERSION) { + header("Cache-Control: max-age=1"); + header('Location: ../setup?reason=upgrade&from=ams', true, 303); + throw new SystemExit(); +} + require_once( $AMS_LIB . '/libinclude.php' ); session_start(); diff --git a/code/web/public_php/setup/database.php b/code/web/public_php/setup/database.php index 16ab10dcd..645e42b19 100644 --- a/code/web/public_php/setup/database.php +++ b/code/web/public_php/setup/database.php @@ -1,5 +1,17 @@