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 @@