Resolve error related to legacy CSRF token handler

This commit is contained in:
billz
2025-05-13 07:49:46 -07:00
parent 992f999a7b
commit a1ca7e861f

View File

@@ -5,19 +5,12 @@ require_once '../../includes/session.php';
require_once '../../includes/config.php'; require_once '../../includes/config.php';
require_once '../../includes/authenticate.php'; require_once '../../includes/authenticate.php';
if (isset($_POST['csrf_token'])) { // set installer path + options
if (csrfValidateRequest() && !CSRFValidate()) { $path = getenv("DOCUMENT_ROOT");
handleInvalidCSRFToken(); $opts = " --update --yes --check 0 --path $path";
} $installer = "sudo /etc/raspap/system/raspbian.sh";
// set installer path + options $execUpdate = $installer.$opts;
$path = getenv("DOCUMENT_ROOT");
$opts = " --update --yes --check 0 --path $path";
$installer = "sudo /etc/raspap/system/raspbian.sh";
$execUpdate = $installer.$opts;
$response = shell_exec($execUpdate); $response = shell_exec($execUpdate);
echo json_encode($response); echo json_encode($response);
} else {
handleInvalidCSRFToken();
}