From b08cc538289838df52fa594fdca0e15c8aca660a Mon Sep 17 00:00:00 2001 From: Nikita Petko Date: Fri, 31 Dec 2021 06:08:06 +0000 Subject: [PATCH] Everything WebsiteSettings! A lot has been changed, everything has been updated to use WebsiteSettingsV2. modified: IsAliveCheck.php modified: globals/Dependencies/Games/Game.php modified: globals/Dependencies/Web/WebContextManager.php modified: globals/Dependencies/Web/WebsiteSettings.php modified: globals/config.php modified: globals/functions.php modified: html/asset/index.php modified: html/download.php modified: html/maintenance.php modified: html_admin/announcements.php modified: html_admin/client-deployer-upload.php modified: html_admin/client-deployer.php modified: html_admin/configuration.php modified: html_clientsettings/Setting/QuietGet/WindowsBootstrapperSettings.php modified: html_setup/BootstrapperSettings.php modified: html_setup/version.php modified: html_setup/versionQTStudio.php modified: html_versioncompatibility/GetAllowedMD5Hashes.php modified: html_versioncompatibility/GetAllowedSecurityKeys.php There's gonna be massive changes with VersionCompatability also, this involves new database tables, and new helpers, that will help support: - More client versions, security versions and client MD5 hashes at once - Better management of versioning, it will automatically update the respected ClientSettingsApplicationBucket with the new version etc. --- IsAliveCheck.php | 17 ++-- globals/Dependencies/Games/Game.php | 8 +- .../Dependencies/Web/WebContextManager.php | 20 ++--- globals/Dependencies/Web/WebsiteSettings.php | 34 ++------ globals/config.php | 3 +- globals/functions.php | 81 ++++++++----------- html/asset/index.php | 4 - html/download.php | 9 ++- html/maintenance.php | 21 +---- html_admin/announcements.php | 12 ++- html_admin/client-deployer-upload.php | 21 +++-- html_admin/client-deployer.php | 28 ++++--- html_admin/configuration.php | 41 +++------- .../QuietGet/WindowsBootstrapperSettings.php | 6 +- html_setup/BootstrapperSettings.php | 6 +- html_setup/version.php | 4 +- html_setup/versionQTStudio.php | 4 +- .../GetAllowedMD5Hashes.php | 3 +- .../GetAllowedSecurityKeys.php | 3 +- 19 files changed, 128 insertions(+), 197 deletions(-) diff --git a/IsAliveCheck.php b/IsAliveCheck.php index 4b4b3d8..11f9bd6 100644 --- a/IsAliveCheck.php +++ b/IsAliveCheck.php @@ -7,6 +7,7 @@ Alphaland 2021 //vars use Alphaland\Web\WebContextManager; +use Alphaland\Web\WebsiteSettings; $thumbalive = false; $gamealive = false; @@ -19,18 +20,14 @@ function checkThumb($override) { if (!$GLOBALS['thumbalive'] or $override) //to prevent flooding mysql calls { - $GLOBALS['thumbalive'] = true; - $set = $GLOBALS['pdo']->prepare("UPDATE websettings SET isThumbnailerAlive = 1"); - $set->execute(); + WebsiteSettings::UpdateSetting('isThumbnailerAlive', true); } } else //thumb arbiter offline { if ($GLOBALS['thumbalive'] or $override) //to prevent flooding mysql calls { - $GLOBALS['thumbalive'] = false; - $set = $GLOBALS['pdo']->prepare("UPDATE websettings SET isThumbnailerAlive = 0"); - $set->execute(); + WebsiteSettings::UpdateSetting('isThumbnailerAlive', false); } } } @@ -42,18 +39,14 @@ function checkGame($override) { if (!$GLOBALS['gamealive'] or $override) //to prevent flooding mysql calls { - $GLOBALS['gamealive'] = true; - $set = $GLOBALS['pdo']->prepare("UPDATE websettings SET IsGameServerAlive = 1"); - $set->execute(); + WebsiteSettings::UpdateSetting('IsGameServerAlive', true); } } else //gameserver arbiter offline { if ($GLOBALS['gamealive'] or $override) //to prevent flooding mysql calls { - $GLOBALS['gamealive'] = false; - $set = $GLOBALS['pdo']->prepare("UPDATE websettings SET IsGameServerAlive = 0"); - $set->execute(); + WebsiteSettings::UpdateSetting('IsGameServerAlive', false); } } } diff --git a/globals/Dependencies/Games/Game.php b/globals/Dependencies/Games/Game.php index b60c084..21d014c 100644 --- a/globals/Dependencies/Games/Game.php +++ b/globals/Dependencies/Games/Game.php @@ -8,6 +8,7 @@ namespace Alphaland\Games { use Alphaland\Assets\Asset; use Alphaland\Grid\RccServiceHelper; + use Alphaland\Web\WebsiteSettings; use Exception; use PDO; @@ -230,12 +231,7 @@ namespace Alphaland\Games { public static function ArbiterOnline() //the main portion of this check is now a background script { - $check = $GLOBALS['pdo']->prepare("SELECT COUNT(*) FROM websettings WHERE isGameServerAlive = 1"); - $check->execute(); - if ($check->fetchColumn() > 0) { - return true; - } - return false; + return WebsiteSettings::GetSetting("isGameServerAlive"); } public static function PersonalBuildRankToName($rank) diff --git a/globals/Dependencies/Web/WebContextManager.php b/globals/Dependencies/Web/WebContextManager.php index 1d23d5a..5201449 100644 --- a/globals/Dependencies/Web/WebContextManager.php +++ b/globals/Dependencies/Web/WebContextManager.php @@ -14,7 +14,7 @@ namespace Alphaland\Web { public static function IsCurrentIpAddressWhitelisted() { $currentIp = WebContextManager::GetCurrentIPAddress(); - $ipWhitelist = explode(";", $GLOBALS['ws']->webservice_whitelist); + $ipWhitelist = explode(";", WebsiteSettings::GetSetting("webservice_whitelist", "127.0.0.0/8;192.168.0.0/16;10.0.0.0/8")); return in_array($currentIp, $ipWhitelist); } @@ -26,13 +26,10 @@ namespace Alphaland\Web { public static function IsUnderMaintenance(bool $status = false) { - $query = $GLOBALS['pdo']->prepare("SELECT * FROM `websettings` WHERE `maintenance` = 1"); - $query->execute(); + $isUnderMaintenance = WebsiteSettings::GetSetting('maintenance'); - if ($query->rowCount() > 0) { - if ($status) { - return true; - } + if ($isUnderMaintenance === true) { + if ($status) return true; return !WebContextManager::CanBypassMaintenance(); } return false; @@ -56,13 +53,8 @@ namespace Alphaland\Web { if (!empty($accesskey)) { - if(WebContextManager::IsCurrentIpAddressWhitelisted()) - { - if($accesskey == $GLOBALS['ws']->webservice_key) - { - return true; - } - } + if(WebContextManager::IsCurrentIpAddressWhitelisted()) + return $accesskey == WebsiteSettings::GetSetting('webservice_key', null); } return false; } diff --git a/globals/Dependencies/Web/WebsiteSettings.php b/globals/Dependencies/Web/WebsiteSettings.php index 293c723..eea4010 100644 --- a/globals/Dependencies/Web/WebsiteSettings.php +++ b/globals/Dependencies/Web/WebsiteSettings.php @@ -15,7 +15,7 @@ namespace Alphaland\Web { use PDO; - /* public static */ class WebsiteSettings + class WebsiteSettings { // default return if no settings are found // because there may be a NULL value in the database @@ -84,7 +84,7 @@ namespace Alphaland\Web { */ public static function GetSetting(string $name, $default = null) { - $query = $GLOBALS['pdo']->prepare("SELECT `value`, `type` FROM `websettings` WHERE `name` = :name"); + $query = $GLOBALS['pdo']->prepare("SELECT `value`, `type` FROM `websettings_v2` WHERE `name` = :name"); $query->bindParam(':name', $name); if (!$query->execute()) { @@ -99,24 +99,6 @@ namespace Alphaland\Web { return self::ConvertStringToValue($result['value'], $result['type']); } - /** - * Gets or sets the value of a website setting. - * - * @param string $name The name of the setting. - * @param mixed $value The value of the setting. - * @param string $type The type of the setting. - * - * @return mixed The value of the setting. - */ - public static function GetOrCreateSetting(string $name, $value = null, string $type = null) - { - if (!self::SettingExists($name)) { - self::UpdateSetting($name, $value, $type); - } - - return self::GetSetting($name); - } - /** * Sets a website setting. * @@ -151,9 +133,9 @@ namespace Alphaland\Web { $query = null; if ($remote === self::DOES_NOT_EXIST) { - $query = $GLOBALS['pdo']->prepare("INSERT INTO `websettings` (`name`, `value`, `type`) VALUES (:name, :value, :type)"); + $query = $GLOBALS['pdo']->prepare("INSERT INTO `websettings_v2` (`name`, `value`, `type`) VALUES (:name, :value, :type)"); } else { - $query = $GLOBALS['pdo']->prepare("UPDATE `websettings` SET `value` = :value, `type` = :type WHERE `name` = :name"); + $query = $GLOBALS['pdo']->prepare("UPDATE `websettings_v2` SET `value` = :value, `type` = :type WHERE `name` = :name"); } if (gettype($value) === 'NULL') { @@ -179,7 +161,7 @@ namespace Alphaland\Web { */ public static function DeleteSetting(string $name): bool { - $query = $GLOBALS['pdo']->prepare("DELETE FROM `websettings` WHERE `name` = :name"); + $query = $GLOBALS['pdo']->prepare("DELETE FROM `websettings_v2` WHERE `name` = :name"); $query->bindParam(':name', $name); return $query->execute(); @@ -192,7 +174,7 @@ namespace Alphaland\Web { */ public static function GetAllSettings(): array { - $query = $GLOBALS['pdo']->prepare("SELECT `name`, `value`, `type` FROM `websettings`"); + $query = $GLOBALS['pdo']->prepare("SELECT `name`, `value`, `type` FROM `websettings_v2`"); if (!$query->execute()) { return []; @@ -218,7 +200,7 @@ namespace Alphaland\Web { */ public static function SettingExists(string $name): bool { - $query = $GLOBALS['pdo']->prepare("SELECT `name` FROM `websettings` WHERE `name` = :name"); + $query = $GLOBALS['pdo']->prepare("SELECT `name` FROM `websettings_v2` WHERE `name` = :name"); $query->bindParam(':name', $name); if (!$query->execute()) { @@ -237,7 +219,7 @@ namespace Alphaland\Web { */ public static function DeleteAllSettings(): bool { - $query = $GLOBALS['pdo']->prepare("DELETE FROM `websettings`"); + $query = $GLOBALS['pdo']->prepare("DELETE FROM `websettings_v2`"); return $query->execute(); } diff --git a/globals/config.php b/globals/config.php index 587b0e9..8ea3153 100644 --- a/globals/config.php +++ b/globals/config.php @@ -41,7 +41,7 @@ try $siteName = "Alphaland"; //site name $domain = "alphaland.cc"; $url = "https://www.".$domain; //site URL - $ws = $pdo->query("SELECT * FROM websettings WHERE id = 1")->fetch(PDO::FETCH_OBJ); //websettings + //websettings $clientUserAgent = "Roblox/WinInet"; $ROBLOXAssetAPI = "https://assetdelivery.roblox.com/v1/asset/?id="; $ROBLOXProductInfoAPI = "https://api.roblox.com/marketplace/productinfo?assetId="; @@ -124,6 +124,7 @@ try include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Administration/SignupKey.php"; include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Economy/EconomyHelper.php"; include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Groups/Group.php"; + include "C:/Webserver/nginx/Alphaland/globals/Dependencies/Web/WebsiteSettings.php"; //authenticator $authenticator = new PHPGangsta_GoogleAuthenticator(); diff --git a/globals/functions.php b/globals/functions.php index e24f10f..5c66b31 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -12,6 +12,7 @@ use Alphaland\Moderation\Filter; use Alphaland\Users\Render as UsersRender; use Alphaland\Users\User; use Alphaland\Web\WebContextManager; +use Alphaland\Web\WebsiteSettings; //safe generation utilities @@ -1528,14 +1529,7 @@ function rewardUserBadge($UserID, $BadgeID, $PlaceID) function isThumbnailerAlive() //the main portion of this check is now a background script { - $check = $GLOBALS['pdo']->prepare("SELECT * FROM websettings WHERE isThumbnailerAlive = 1"); - $check->execute(); - - if ($check->rowCount() > 0) - { - return true; - } - return false; + return WebsiteSettings::GetSetting("isThumbnailerAlive"); } function verifyLuaValue($value) //mostly due to booleans, but maybe something will come up in the future @@ -2536,22 +2530,18 @@ function userPlaceVisits($userid) function enableMaintenance($custom) { - if (!empty($custom)) { - $setmaintenance = $GLOBALS['pdo']->prepare("UPDATE websettings SET maintenance = 1, maintenance_text = :t"); - $setmaintenance->bindParam(":t", $custom, PDO::PARAM_STR); - $setmaintenance->execute(); - } else { - $setmaintenance = $GLOBALS['pdo']->prepare("UPDATE websettings SET maintenance = 1"); - $setmaintenance->execute(); - } + if (!empty($custom)) + WebsiteSettings::UpdateSetting("maintenance_text", $custom); + + WebsiteSettings::UpdateSetting("maintenance", true); soapCloseAllJobs($GLOBALS['gamesArbiter']); } function disableMaintenance() { - $setmaintenance = $GLOBALS['pdo']->prepare("UPDATE websettings SET maintenance = 0, maintenance_text = ''"); - $setmaintenance->execute(); + WebsiteSettings::UpdateSetting("maintenance", false); + WebsiteSettings::UpdateSetting("maintenance_text", ""); } function setUserRank($rank, $userid) @@ -3005,43 +2995,36 @@ function getNav() function fetchAnnouncement() { - $announcementquery = $GLOBALS['pdo']->prepare("SELECT * FROM websettings"); - $announcementquery->execute(); - $announcementquery = $announcementquery->fetch(PDO::FETCH_OBJ); - $announcement = cleanOutput($announcementquery->announcement); //clean output - if (empty($announcementquery->announcement)) + $announcement = WebsiteSettings::GetSetting("announcement"); + + if (empty($announcement)) return ""; + + $cleanAnnouncement = cleanOutput($announcement); //clean output + + $announcement_color = WebsiteSettings::GetSetting("announcement_color"); + + $html = ""; + + switch ($announcement_color) { - return ""; - } - else - { - $html = ""; - if ($announcementquery->announcement_color == "red") - { - $html = ""; - } - elseif ($announcementquery->announcement_color == "blue") - { - $html = ""; - } - elseif ($announcementquery->announcement_color == "green") - { - $html = ""; - } - return $html; + case "red": + $html = ""; + break; + case "green": + $html = ""; + break; + case "blue": + default: + $html = ""; + break; } + + return $html; } function canRegister() { - $check = $GLOBALS['pdo']->prepare("SELECT * FROM websettings WHERE registration = 1"); - $check->execute(); - - if($check->rowCount() > 0) - { - return true; - } - return false; + return WebsiteSettings::GetSetting("registration", false); } function adminPanelStats() { diff --git a/html/asset/index.php b/html/asset/index.php index 30faa95..0dd27ad 100644 --- a/html/asset/index.php +++ b/html/asset/index.php @@ -32,10 +32,6 @@ function ReturnAsset($hash, $assettypeid) //this determines which cdn to grab an ReturnAssetFromHash($hash); } } - -$websettings = $pdo->prepare("SELECT * FROM websettings"); -$websettings->execute(); -$websettings = $websettings->fetch(PDO::FETCH_OBJ); if ($id) { diff --git a/html/download.php b/html/download.php index 0e05914..04328f6 100644 --- a/html/download.php +++ b/html/download.php @@ -1,8 +1,13 @@ AlphalandVersion."-AlphalandLauncher.exe"; + $loc = $GLOBALS['setupHtmlPath'].$alphalandVersion."-AlphalandLauncher.exe"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=AlphalandLauncher.exe"); echo file_get_contents($loc); @@ -10,7 +15,7 @@ if (isset($_POST['SubmitClient'])) if (isset($_POST['SubmitStudio'])) { - $loc = $GLOBALS['setupHtmlPath'].$ws->AlphalandStudioVersion."-AlphalandStudioLauncher.exe"; + $loc = $GLOBALS['setupHtmlPath'].$alphalandStudioVersion."-AlphalandStudioLauncher.exe"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=AlphalandStudioLauncher.exe"); echo file_get_contents($loc); diff --git a/html/maintenance.php b/html/maintenance.php index 75be226..08028a7 100644 --- a/html/maintenance.php +++ b/html/maintenance.php @@ -1,25 +1,12 @@ prepare("SELECT * FROM websettings"); -$websettings->execute(); -$websettings = $websettings->fetch(PDO::FETCH_OBJ); - -$status = ''; -if (!empty($websettings->maintenance_text)) -{ - $status = $websettings->maintenance_text; //use custom text -} -else -{ - $status = $websettings->default_maintenance_text; //default maintenance text -} +$maintenance_text = WebsiteSettings::GetSetting('maintenance_text') ?? WebsiteSettings::GetSetting("default_maintenance_text"); $body = << @@ -54,8 +41,8 @@ body {
-

{$status}

+

{$maintenance_text}

EOT; -echo $body; \ No newline at end of file +echo $body; diff --git a/html_admin/announcements.php b/html_admin/announcements.php index 859ae23..7b55122 100644 --- a/html_admin/announcements.php +++ b/html_admin/announcements.php @@ -1,6 +1,7 @@ prepare('UPDATE websettings SET announcement = "", announcement_color = ""'); - $setsecmd5->execute(); + WebsiteSettings::UpdateSetting('announcement', ""); + WebsiteSettings::UpdateSetting('announcement_color', ""); } else { @@ -47,10 +47,8 @@ if (isset($_POST['setannouncement'])) { $color = "red"; } - $setsecmd5 = $pdo->prepare("UPDATE websettings SET announcement = :m, announcement_color = :c"); - $setsecmd5->bindParam(":m", $_POST['setannouncement'], PDO::PARAM_STR); - $setsecmd5->bindParam(":c", $color, PDO::PARAM_STR); - $setsecmd5->execute(); + WebsiteSettings::UpdateSetting('announcement', $_POST['setannouncement']); + WebsiteSettings::UpdateSetting('announcement_color', $color); } } } diff --git a/html_admin/client-deployer-upload.php b/html_admin/client-deployer-upload.php index 0bd3d48..3e14354 100644 --- a/html_admin/client-deployer-upload.php +++ b/html_admin/client-deployer-upload.php @@ -1,6 +1,7 @@ AlphalandVersion; + $previousdeployversion = WebsiteSettings::GetSetting("AlphalandVersion"); } else if ($deploytype == "studio") { - $previousdeployversion = $ws->AlphalandStudioVersion; + $previousdeployversion = WebsiteSettings::GetSetting("AlphalandStudioVersion"); } //deploy type specific stuff @@ -168,17 +169,13 @@ if ($pass) { //update in db if ($deploytype == "client") { - $updatewebsettings = $pdo->prepare("UPDATE websettings SET AlphalandVersion = :av, security_version = :sv, md5_hash = :mh, GameFileVersion = :gv"); - $updatewebsettings->bindParam(":av", $newgameversion, PDO::PARAM_STR); - $updatewebsettings->bindParam(":sv", $gamesecurityversion, PDO::PARAM_STR); - $updatewebsettings->bindParam(":mh", $gamemd5hash, PDO::PARAM_STR); - $updatewebsettings->bindParam(":gv", $gamefileversion, PDO::PARAM_STR); - $updatewebsettings->execute(); + WebsiteSettings::UpdateSetting("AlphalandVersion", $newgameversion); + WebsiteSettings::UpdateSetting("security_version", $gamesecurityversion); + WebsiteSettings::UpdateSetting("md5_hash", $gamemd5hash); + WebsiteSettings::UpdateSetting("GameFileVersion", $gamefileversion); } else if ($deploytype == "studio") { - $updatewebsettings = $pdo->prepare("UPDATE websettings SET AlphalandStudioVersion = :asv, StudioFileVersion = :sfv"); - $updatewebsettings->bindParam(":asv", $newgameversion, PDO::PARAM_STR); - $updatewebsettings->bindParam(":sfv", $gamefileversion, PDO::PARAM_STR); - $updatewebsettings->execute(); + WebsiteSettings::UpdateSetting("AlphalandStudioVersion", $newgameversion); + WebsiteSettings::UpdateSetting("StudioFileVersion", $gamefileversion); } //output the new version diff --git a/html_admin/client-deployer.php b/html_admin/client-deployer.php index 9e3a6c6..183b380 100644 --- a/html_admin/client-deployer.php +++ b/html_admin/client-deployer.php @@ -1,10 +1,11 @@ IsOwner())) { +if (!($user->IsOwner())) { if ($user->IsAdmin()) { WebContextManager::Redirect("/"); } @@ -13,11 +14,14 @@ if(!($user->IsOwner())) { adminPanelStats(); -$alert = ''; - - $body = << - {$alert}
Network Security Key Generator
MAKE SURE TO DEPLOY RCC WITH UPDATED KEY
@@ -30,7 +34,7 @@ $alert = '';
Game Security Version
- +
Generated Security Key
@@ -75,19 +79,19 @@ $alert = '';
Game Executable Security Version
- +
Game Executable MD5 Hash
- +
Game Executable Version (separated by '.')
- +
Game Launcher File Version (separated by ',') Ex:1, 2, 3, 4
@@ -132,7 +136,7 @@ $alert = '';
Studio Executable Version (separated by '.')
- +
Studio Launcher File Version (separated by ',')
@@ -202,8 +206,8 @@ $alert = ''; EOT; pageHandler(); -$ph->pagetitle = ""; +$ph->pagetitle = ""; $ph->navbar = ""; $ph->body = $body; $ph->footer = ""; -$ph->output(); \ No newline at end of file +$ph->output(); diff --git a/html_admin/configuration.php b/html_admin/configuration.php index 5f83bad..ef0c360 100644 --- a/html_admin/configuration.php +++ b/html_admin/configuration.php @@ -1,6 +1,7 @@ prepare("SELECT * FROM websettings WHERE maintenance = 1"); -$maintenancequery->execute(); - -$status = $pdo->prepare("SELECT * FROM websettings WHERE maintenance = 1"); -$status->execute(); - -$websettings = $pdo->prepare("SELECT * FROM websettings"); -$websettings->execute(); -$websettings = $websettings->fetch(PDO::FETCH_OBJ); +$isUnderMaitenance = WebsiteSettings::GetSetting('maintenance'); +$rccKey = WebsiteSettings::GetSetting('webservice_key'); +$ipWhitelist = WebsiteSettings::GetSetting("webservice_whitelist"); ////end db queries ////Third party web queries @@ -127,43 +122,31 @@ if (isset($_POST['clearcachesubmit'])) if (isset($_POST['submitwskey'])) { $key = genHash(16); - $setwskey = $pdo->prepare("UPDATE websettings SET webservice_key = :k"); - $setwskey->bindParam(":k", $key, PDO::PARAM_STR); - $setwskey->execute(); + WebsiteSettings::UpdateSetting("webservice_key", $key); WebContextManager::Redirect("configuration"); } if (isset($_POST['setwsipwhitelist'])) { - $setwsip = $pdo->prepare("UPDATE websettings SET webservice_whitelist = :w"); - $setwsip->bindParam(":w", $_POST['setwsipwhitelist'], PDO::PARAM_STR); - $setwsip->execute(); + WebsiteSettings::UpdateSetting("webservice_whitelist", $_POST['setwsipwhitelist']); WebContextManager::Redirect("configuration"); } if (isset($_POST['cachingon'])) { - $setapprovals = $pdo->prepare("UPDATE websettings SET avatarCaching = 1"); - $setapprovals->execute(); + WebsiteSettings::UpdateSetting("avatarCaching", true); WebContextManager::Redirect("configuration"); } if (isset($_POST['cachingoff'])) { - $setapprovals = $pdo->prepare("UPDATE websettings SET avatarCaching = 0"); - $setapprovals->execute(); + WebsiteSettings::UpdateSetting("avatarCaching", false); WebContextManager::Redirect("configuration"); } -$maintenancestatus = ""; -if ($maintenancequery->rowCount() > 0) -{ +$maintenancestatus = 'OFF'; +if ($isUnderMaitenance === true) $maintenancestatus = 'ON'; -} -else -{ - $maintenancestatus = 'OFF'; -} $developmentmodestatus = ""; if ($devmode) @@ -236,7 +219,7 @@ $body = <<
- +
@@ -262,7 +245,7 @@ $body = <<
-
Current Backend Whitelisted IP's:
{$websettings->webservice_whitelist}
+
Current Backend Whitelisted IP's:
{$ipWhitelist}

diff --git a/html_clientsettings/Setting/QuietGet/WindowsBootstrapperSettings.php b/html_clientsettings/Setting/QuietGet/WindowsBootstrapperSettings.php index 8905833..313884f 100644 --- a/html_clientsettings/Setting/QuietGet/WindowsBootstrapperSettings.php +++ b/html_clientsettings/Setting/QuietGet/WindowsBootstrapperSettings.php @@ -1,3 +1,7 @@ GameFileVersion.'", "ValidateInstalledExeVersion": "True", "ShowInstallSuccessPrompt": "True"}'; \ No newline at end of file +use Alphaland\Web\WebsiteSettings; + +$gameFileVersion = WebsiteSettings::GetSetting('GameFileVersion'); + +echo '{"ExeVersion": "' . $gameFileVersion . '", "ValidateInstalledExeVersion": "True", "ShowInstallSuccessPrompt": "True"}'; diff --git a/html_setup/BootstrapperSettings.php b/html_setup/BootstrapperSettings.php index 8905833..313884f 100644 --- a/html_setup/BootstrapperSettings.php +++ b/html_setup/BootstrapperSettings.php @@ -1,3 +1,7 @@ GameFileVersion.'", "ValidateInstalledExeVersion": "True", "ShowInstallSuccessPrompt": "True"}'; \ No newline at end of file +use Alphaland\Web\WebsiteSettings; + +$gameFileVersion = WebsiteSettings::GetSetting('GameFileVersion'); + +echo '{"ExeVersion": "' . $gameFileVersion . '", "ValidateInstalledExeVersion": "True", "ShowInstallSuccessPrompt": "True"}'; diff --git a/html_setup/version.php b/html_setup/version.php index 8f9067f..666dc30 100644 --- a/html_setup/version.php +++ b/html_setup/version.php @@ -1,3 +1,5 @@ AlphalandVersion; \ No newline at end of file +use Alphaland\Web\WebsiteSettings; + +echo WebsiteSettings::GetSetting('AlphalandVersion'); \ No newline at end of file diff --git a/html_setup/versionQTStudio.php b/html_setup/versionQTStudio.php index 3fe5b0f..4cf93a0 100644 --- a/html_setup/versionQTStudio.php +++ b/html_setup/versionQTStudio.php @@ -1,3 +1,5 @@ AlphalandStudioVersion; \ No newline at end of file +use Alphaland\Web\WebsiteSettings; + +echo WebsiteSettings::GetSetting('AlphalandStudioVersion'); \ No newline at end of file diff --git a/html_versioncompatibility/GetAllowedMD5Hashes.php b/html_versioncompatibility/GetAllowedMD5Hashes.php index 25be55b..3a448e7 100644 --- a/html_versioncompatibility/GetAllowedMD5Hashes.php +++ b/html_versioncompatibility/GetAllowedMD5Hashes.php @@ -1,6 +1,7 @@ array( - $ws->md5_hash + WebsiteSettings::GetSetting("md5_hash"), ) ), JSON_UNESCAPED_SLASHES); diff --git a/html_versioncompatibility/GetAllowedSecurityKeys.php b/html_versioncompatibility/GetAllowedSecurityKeys.php index 4d72faa..d9b8ae7 100644 --- a/html_versioncompatibility/GetAllowedSecurityKeys.php +++ b/html_versioncompatibility/GetAllowedSecurityKeys.php @@ -1,6 +1,7 @@ array( - $ws->security_version + WebsiteSettings::GetSetting("security_version"), ) ), JSON_UNESCAPED_SLASHES); \ No newline at end of file