diff --git a/html/includes/functions.php b/html/includes/functions.php index ba537186d..e380b18ec 100644 --- a/html/includes/functions.php +++ b/html/includes/functions.php @@ -106,10 +106,10 @@ function verifyNumber($num) { $lastChanged = null; $remoteWebsiteURL = null; $settings_array = null; -$useLocalWebsite = null; -$useRemoteWebsite = null; -$hasLocalWebsite = null; -$hasRemoteWebsite = null; +$useLocalWebsite = false; +$useRemoteWebsite = false; +$hasLocalWebsite = false; +$hasRemoteWebsite = false; $endSetting = "XX_END_XX"; function readSettingsFile() { @@ -145,20 +145,18 @@ function initialize_variables($website_only=false) { $settings_array = readSettingsFile(); - // See if there are any website configuration files. - // Assume if there are, that website is in use. + // See if there are any Website configuration files. + // The "has" variables just mean the associated configuration file exists, + // and in the case of a remote Website, that it also has a URL. + // The "use" variables means we're actually using the Website. if (file_exists(getLocalWebsiteConfigFile())) { $hasLocalWebsite = true; - } else { - $hasLocalWebsite = false; + $useLocalWebsite = toBool(getVariableOrDefault($settings_array, 'uselocalwebsite', "false")); } - if (file_exists(getRemoteWebsiteConfigFile())) { + if (file_exists(getRemoteWebsiteConfigFile()) && getVariableOrDefault($settings_array, "remotewebsiteurl", "") !== "") { $hasRemoteWebsite = true; - } else { - $hasRemoteWebsite = false; + $useRemoteWebsite = toBool(getVariableOrDefault($settings_array, 'useremotewebsite', "false")); } - $useLocalWebsite = toBool(getVariableOrDefault($settings_array, 'uselocalwebsite', "false")); - $useRemoteWebsite = toBool(getVariableOrDefault($settings_array, 'useremotewebsite', "false")); if ($website_only) return; diff --git a/html/index.php b/html/index.php index d1410d869..be3dd4ae2 100644 --- a/html/index.php +++ b/html/index.php @@ -224,12 +224,8 @@ function DisplayTorProxyConfig() {}     "; - if ($remoteWebsiteURL !== "") { - echo ""; - echo "Remote Website $remoteWebsiteVersion"; - } else { - echo "Remote Website $remoteWebsiteVersion (unknown URL)"; - } + echo ""; + echo "Remote Website $remoteWebsiteVersion"; } ?>