I dunno what I was doing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$latestVersion = "1.5.2";
|
$latestVersion = "1.5.2";
|
||||||
$latestBetaVersion = "1.6-dev";
|
$latestBetaVersion = "1.6-dev";
|
||||||
$allowedVersions = [$latestVersion, $allowedVersions];
|
$allowedVersions = [$latestVersion, $latestBetaVersion];
|
||||||
$allowedDatabaseVersions = [$latestVersion, $allowedVersions];
|
$allowedDatabaseVersions = [$latestVersion, $latestBetaVersion];
|
||||||
@@ -3,24 +3,6 @@ require __DIR__ . '/../config/general.php';
|
|||||||
require __DIR__ . '/../incl/util.php';
|
require __DIR__ . '/../incl/util.php';
|
||||||
setPlainHeader();
|
setPlainHeader();
|
||||||
|
|
||||||
function isSupportedVersion($version) {
|
|
||||||
global $latestVersion;
|
|
||||||
if (!isset($latestVersion)) require __DIR__ . '/../config/general.php';
|
|
||||||
return $version === $latestVersion || $version === $latestBetaVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isAllowedVersion($version) {
|
|
||||||
global $allowedVersions;
|
|
||||||
if (!isset($allowedVersions)) require __DIR__ . '/../config/general.php';
|
|
||||||
return in_array($version, $allowedVersions);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isAllowedDatabaseVersion($version) {
|
|
||||||
global $allowedDatabaseVersions;
|
|
||||||
if (!isset($allowedDatabaseVersions)) require __DIR__ . '/../config/general.php';
|
|
||||||
return in_array($version, $allowedDatabaseVersions);
|
|
||||||
}
|
|
||||||
|
|
||||||
$clientVersion = $_SERVER['HTTP_CLIENTVERSION'] ?? "0";
|
$clientVersion = $_SERVER['HTTP_CLIENTVERSION'] ?? "0";
|
||||||
if (($_SERVER['HTTP_REQUESTER'] ?? "0") != "BerryDashClient") {
|
if (($_SERVER['HTTP_REQUESTER'] ?? "0") != "BerryDashClient") {
|
||||||
exitWithMessage("-1", false);
|
exitWithMessage("-1", false);
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
$requester = $_SERVER['HTTP_REQUESTER'] ?? '';
|
|
||||||
|
|
||||||
function setPlainHeader() {
|
function setPlainHeader() {
|
||||||
header("Content-Type: text/plain");
|
header("Content-Type: text/plain");
|
||||||
}
|
}
|
||||||
@@ -51,12 +49,30 @@ function exitWithMessage($message, $encrypt = true) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSupportedVersion($version) {
|
||||||
|
global $latestVersion;
|
||||||
|
if (!isset($latestVersion)) require __DIR__ . '/../config/general.php';
|
||||||
|
return $version === $latestVersion || $version === $latestBetaVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isAllowedVersion($version) {
|
||||||
|
global $allowedVersions;
|
||||||
|
if (!isset($allowedVersions)) require __DIR__ . '/../config/general.php';
|
||||||
|
return in_array($version, $allowedVersions);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isAllowedDatabaseVersion($version) {
|
||||||
|
global $allowedDatabaseVersions;
|
||||||
|
if (!isset($allowedDatabaseVersions)) require __DIR__ . '/../config/general.php';
|
||||||
|
return in_array($version, $allowedDatabaseVersions);
|
||||||
|
}
|
||||||
|
|
||||||
function checkClientDatabaseVersion() {
|
function checkClientDatabaseVersion() {
|
||||||
global $allowedDatabaseVersions;
|
global $allowedDatabaseVersions;
|
||||||
if (!isset($allowedDatabaseVersions)) require __DIR__ . '/../config/general.php';
|
if (!isset($allowedDatabaseVersions)) require __DIR__ . '/../config/general.php';
|
||||||
if (!isset($_SERVER['HTTP_REQUESTER'])) exitWithMessage("-998");
|
if (!isset($_SERVER['HTTP_REQUESTER'])) exitWithMessage("-998");
|
||||||
if ($_SERVER['HTTP_REQUESTER'] != "BerryDashClient") return;
|
if ($_SERVER['HTTP_REQUESTER'] != "BerryDashClient") exitWithMessage("-998");
|
||||||
if (!in_array($_SERVER['HTTP_CLIENTVERSION'] ?? '', $allowedDatabaseVersions) || $_SERVER['HTTP_REQUESTER'] != "BerryDashClient") exitWithMessage("-998");
|
if (!in_array($_SERVER['HTTP_CLIENTVERSION'] ?? '', $allowedDatabaseVersions)) exitWithMessage("-998");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPostData() {
|
function getPostData() {
|
||||||
|
|||||||
Reference in New Issue
Block a user