require_once "adminsetup.php"; // message is used to provide feedback to the user //eg. if we get here from an expired session $message = ''; // Authentication class required for admin functions require_once $include_dir . "SimpleAuth.php"; // add this here as not required for some pages (which use Quiz.php instead) require_once $include_dir . "Quizzes.php"; // must add this before we require the menu $admin_menu = 'home'; /*** Authentication ***/ // user must be logged in for any admin functions // this needs to be before we output anything as it uses sessions (cookies) $auth = new SimpleAuth($settings->getSetting('admin_login_username'), $settings->getSetting('admin_login_password'), $settings->getSetting('admin_login_expirytime')); // if not logged in redirect to login page $status = $auth->checkLogin(); if ($status != 1) { // no from as use default which goes back to this page header("Location: " . ADMIN_LOGIN_FILE . "?status={$status}&location=aupgrade"); // header will redirect to a new page so we just close this script exit(0); //Important to stop script here } // If we reach here then login was successful $sessionUsername = $auth->getUser(); // Have we get the filename of the old version in the post if (isset($_POST['oldfile']) && $_POST['oldfile'] != "") { $oldfile = $_POST['oldfile']; // check that the file exists if (!file_exists($oldfile)) { printMenu("File does not exist - please try again");