From a9a9b9339adb0c09c22c0aa0f0cfc7701e1ac618 Mon Sep 17 00:00:00 2001 From: Alex Greenland Date: Sun, 22 Dec 2024 21:36:44 +0000 Subject: [PATCH] #4003 Make XX_NEED_TO_UPDATE_XX a defined variable --- config_repo/allskyDefines.inc.repo | 1 + html/allsky/functions.php | 5 ++--- html/includes/editor.php | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config_repo/allskyDefines.inc.repo b/config_repo/allskyDefines.inc.repo index 2c1978ed9..b1a34f8ea 100644 --- a/config_repo/allskyDefines.inc.repo +++ b/config_repo/allskyDefines.inc.repo @@ -29,6 +29,7 @@ define('ALLSKY_VERSION', 'XX_ALLSKY_VERSION_XX'); define('ALLSKY_STATUS', 'XX_ALLSKY_STATUS_XX'); define('RASPI_CONFIG', 'XX_RASPI_CONFIG_XX'); define('RASPI_ADMIN_DETAILS', 'XX_RASPI_CONFIG_XX/raspap.auth'); +define('CONFIG_UPDATE_STRING', 'XX_NEED_TO_UPDATE_XX'); // Split the placeholder so it doesn't get replaced. if (ALLSKY_HOME == "XX_ALLSKY_HOME" . "_XX") { diff --git a/html/allsky/functions.php b/html/allsky/functions.php index 27be9336e..d469a338a 100644 --- a/html/allsky/functions.php +++ b/html/allsky/functions.php @@ -16,7 +16,6 @@ function initialize() { global $webSettings_array; global $configFilePrefix; - $needToUpdateString = "XX_NEED_TO_UPDATE_XX"; $configurationFileName = "configuration.json"; $retMsg = ""; @@ -32,11 +31,11 @@ function initialize() { return($retMsg); } $webSettings_str = file_get_contents($configuration_file, true); - if (strpos($webSettings_str, $needToUpdateString) !== false) { + if (strpos($webSettings_str, CONFIG_UPDATE_STRING) !== false) { $retMsg .= "

"; $retMsg .= "The '$configurationFileName' file needs to be updated via"; $retMsg .= " the 'Editor' page in the WebUI."; - $retMsg .= "

Update fields with '$needToUpdateString'"; + $retMsg .= "

Update fields with '".CONFIG_UPDATE_STRING."'"; $retMsg .= " and check all other entries."; $retMsg .= "

This Allsky Website will not work until updated."; $retMsg .= "

"; diff --git a/html/includes/editor.php b/html/includes/editor.php index e66866d52..2c9a0cb76 100644 --- a/html/includes/editor.php +++ b/html/includes/editor.php @@ -61,6 +61,7 @@ function DisplayEditor() } ?>