mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Require CORS check on all admin pages
This is mainly added so that an ad can't enable/disable the Pi-hole by simply loading a url like `http://pi.hole/admin/index.php?disable`
This commit is contained in:
+10
-7
@@ -1,12 +1,15 @@
|
||||
<?php
|
||||
require "php/auth.php";
|
||||
check_cors();
|
||||
if (isset($_GET['enable'])) {
|
||||
exec('sudo pihole enable');
|
||||
$refer = $_SERVER['HTTP_REFERER'];
|
||||
header("location:$refer");
|
||||
} elseif (isset($_GET['disable'])) {
|
||||
exec('sudo pihole disable');
|
||||
$refer = $_SERVER['HTTP_REFERER'];
|
||||
header("location:$refer");
|
||||
exec('sudo pihole enable');
|
||||
$refer = $_SERVER['HTTP_REFERER'];
|
||||
header("location:$refer");
|
||||
}
|
||||
elseif (isset($_GET['disable'])) {
|
||||
exec('sudo pihole disable');
|
||||
$refer = $_SERVER['HTTP_REFERER'];
|
||||
header("location:$refer");
|
||||
}
|
||||
$cmd = "echo $((`cat /sys/class/thermal/thermal_zone0/temp | cut -c1-2`))";
|
||||
$output = shell_exec($cmd);
|
||||
|
||||
Reference in New Issue
Block a user