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:
@@ -2,12 +2,19 @@
|
||||
|
||||
require '../../includes/csrf.php';
|
||||
require_once '../../includes/config.php';
|
||||
require_once '../../src/RaspAP/Auth/HTTPAuth.php';
|
||||
require_once '../../includes/authenticate.php';
|
||||
require_once '../../includes/functions.php';
|
||||
|
||||
if (isset($_POST['logfile'])) {
|
||||
$logfile = escapeshellcmd($_POST['logfile']);
|
||||
$logfile = escapeshellarg($_POST['logfile']);
|
||||
$valid = '/(\/var\/log|\/tmp)/';
|
||||
|
||||
// truncate requested log file
|
||||
exec("sudo truncate -s 0 $logfile", $return);
|
||||
if (preg_match($valid, $logfile)) {
|
||||
// truncate requested log file
|
||||
exec("sudo truncate -s 0 $logfile", $return);
|
||||
} else {
|
||||
$return = 1;
|
||||
}
|
||||
echo json_encode($return);
|
||||
}
|
||||
|
Reference in New Issue
Block a user