From 8f3b4d081bc9d632cfefe4513f122ebbd4cc0973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20Kerem=20Oktay?= Date: Mon, 17 Aug 2020 00:03:58 +0300 Subject: [PATCH] Check for updates (celebration_emoji) --- index.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.php b/index.php index 3fef3f0..7ee7450 100644 --- a/index.php +++ b/index.php @@ -66,6 +66,22 @@ fclose($versionfile); if($db->getSetting($mysqli,"dbConfigVersion") != $appversion){ die("Database needs to be updated. Please update the database and try again. App Version: '".$appversion."' DB Settings Version: '".$db->getSetting($mysqli,"dbConfigVersion")."'."); } +$useedf = fopen("updateseed", "r") or die("Unable to open updateseed file!"); +$useed = fread($versionfile,filesize("updateseed")); +fclose($useedf); +if($useed == "stable"){ +$remoteversion = file_get_contents("https://skkyfallenhosted.ml/serverstatus/versionauthority/stable/version"); +$remotedl = file_get_contents("https://skkyfallenhosted.ml/serverstatus/versionauthority/stable/dl"); +} +if($useed == "beta"){ +$remoteversion = file_get_contents("https://skkyfallenhosted.ml/serverstatus/versionauthority/beta/version"); +$remotedl = file_get_contents("https://skkyfallenhosted.ml/serverstatus/versionauthority/beta/dl"); +} +if($db->getSetting($mysqli,"notifyUpdate") == "yes"){ + if($remoteversion != $appversion){ + die("Your installation is not upp to date! Download the new update from: '".$remotedl."'"); + } +} Template::render_header("Status"); ?>