mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 11:19:59 +01:00
require auth for the customDNS page
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
@@ -4,7 +4,18 @@
|
||||
|
||||
$customDNSFile = "/etc/pihole/custom.list";
|
||||
|
||||
switch ($_REQUEST['action'])
|
||||
require_once('auth.php');
|
||||
|
||||
// Authentication checks
|
||||
if (isset($_POST['token'])) {
|
||||
check_cors();
|
||||
check_csrf($_POST['token']);
|
||||
} else {
|
||||
log_and_die('Not allowed (login session invalid or expired, please relogin on the Pi-hole dashboard)!');
|
||||
}
|
||||
|
||||
|
||||
switch ($_POST['action'])
|
||||
{
|
||||
case 'get': echo json_encode(echoCustomDNSEntries()); break;
|
||||
case 'add': echo json_encode(addCustomDNSEntry()); break;
|
||||
@@ -12,4 +23,6 @@
|
||||
default:
|
||||
die("Wrong action");
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user