Files
web/php/add.php
Mcat12 d2fcc36341 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`
2016-11-07 21:10:36 -05:00

22 lines
398 B
PHP

<?php
require('auth.php');
if(!isset($_POST['domain'], $_POST['list'], $_POST['token'])) {
log_and_die("Missing POST variables");
}
check_cors();
check_csrf();
check_domain();
switch($_POST['list']) {
case "white":
echo exec("sudo pihole -w -q ${_POST['domain']}");
break;
case "black":
echo exec("sudo pihole -b -q ${_POST['domain']}");
break;
}
?>