mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Add authentication to ajax pages, thx @lts-rad
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
require '../../includes/csrf.php';
|
||||
require_once '../../includes/config.php';
|
||||
require_once '../../src/RaspAP/Auth/HTTPAuth.php';
|
||||
require_once '../../includes/authenticate.php';
|
||||
|
||||
$action = escapeshellcmd($_POST['a']);
|
||||
|
||||
@@ -18,4 +21,3 @@ if (isset($action)) {
|
||||
}
|
||||
echo json_encode($response);
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,8 @@
|
||||
|
||||
require '../../includes/csrf.php';
|
||||
require_once '../../includes/config.php';
|
||||
require_once '../../src/RaspAP/Auth/HTTPAuth.php';
|
||||
require_once '../../includes/authenticate.php';
|
||||
|
||||
if (isset($_POST['csrf_token'])) {
|
||||
if (csrfValidateRequest() && !CSRFValidate()) {
|
||||
@@ -20,4 +22,3 @@ if (isset($_POST['csrf_token'])) {
|
||||
} else {
|
||||
handleInvalidCSRFToken();
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
require '../../includes/csrf.php';
|
||||
require_once '../../includes/config.php';
|
||||
require_once '../../src/RaspAP/Auth/HTTPAuth.php';
|
||||
require_once '../../includes/authenticate.php';
|
||||
|
||||
$tempDir = sys_get_temp_dir();
|
||||
$filePath = $tempDir . DIRECTORY_SEPARATOR . RASPI_DEBUG_LOG;
|
||||
@@ -19,4 +21,3 @@ if (isset($filePath)) {
|
||||
header('Location: '.'/system_info');
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
require '../../includes/csrf.php';
|
||||
require_once '../../includes/config.php';
|
||||
require_once '../../src/RaspAP/Auth/HTTPAuth.php';
|
||||
require_once '../../includes/authenticate.php';
|
||||
|
||||
if (isset($_POST['csrf_token'])) {
|
||||
if (csrfValidateRequest() && !CSRFValidate()) {
|
||||
@@ -18,4 +21,3 @@ if (isset($_POST['csrf_token'])) {
|
||||
} else {
|
||||
handleInvalidCSRFToken();
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
require_once '../../includes/config.php';
|
||||
require_once '../../src/RaspAP/Auth/HTTPAuth.php';
|
||||
require_once '../../includes/authenticate.php';
|
||||
|
||||
$logFile = '/tmp/raspap_install.log';
|
||||
$searchStrings = [
|
||||
'Configure update' => 1,
|
||||
@@ -40,4 +44,3 @@ if (file_exists($logFile)) {
|
||||
} else {
|
||||
echo json_encode("File does not exist: $logFile");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user