From 62aab3e1c9ad69f5af0a2804fc808676351d2687 Mon Sep 17 00:00:00 2001 From: Yigit Kerem Oktay Date: Sat, 26 Dec 2020 22:38:05 +0300 Subject: [PATCH] Fix software updater bug --- SoftwareUpdater.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/SoftwareUpdater.php b/SoftwareUpdater.php index 10236d5..dd2393d 100644 --- a/SoftwareUpdater.php +++ b/SoftwareUpdater.php @@ -10,17 +10,13 @@ // Include Updater Configuration require_once "Configuration/UpdaterConfiguration.php"; +session_name("SecureFormSession"); +session_start(); -// Check if Session is already open otherwise create a new one. -if(session_status() == PHP_SESSION_NONE) { - session_name("SecureFormsSession"); - session_start(); -} else { - // Make sure we are logged in and update s authorised. - if (!$_SESSION["loggedin"] and isset($_SESSION["UPDATE_AUTHORIZED"]) and $_SESSION["UPDATE_AUTHORIZED"] == "TRUE") { - // Redirect to / if not. - header("Location: /"); - } +// Make sure we are logged in and update s authorised. +if (!$_SESSION["UPDATE_AUTHORIZED"] == "TRUE") { + // Stop execution with an error message + die("Skyfallen SecureForms stopped execution. Update not authorized."); } /** * Deletes a folder recursively excluding Configuration and RSA Key Directories