Skip to content

Commit

Permalink
Merge pull request #3968 from AllskyTeam/has-and-use-Website-changes
Browse files Browse the repository at this point in the history
"has" and "use" Website changes
  • Loading branch information
EricClaeys authored Nov 18, 2024
2 parents ecb9c49 + 48bccc2 commit d7efb0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
24 changes: 11 additions & 13 deletions html/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 2 additions & 6 deletions html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,8 @@ function DisplayTorProxyConfig() {}
   
<?php if ($useRemoteWebsite) {
echo "<span class='nowrap'>";
if ($remoteWebsiteURL !== "") {
echo "<a external='true' class='version-title-color' href='$remoteWebsiteURL'>";
echo "Remote Website $remoteWebsiteVersion</a></span>";
} else {
echo "Remote Website $remoteWebsiteVersion (unknown URL)";
}
echo "<a external='true' class='version-title-color' href='$remoteWebsiteURL'>";
echo "Remote Website $remoteWebsiteVersion</a></span>";
} ?>
</div>
</div> <!-- /.navbar-header -->
Expand Down

0 comments on commit d7efb0a

Please sign in to comment.