mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
22 lines
409 B
PHP
22 lines
409 B
PHP
<?php
|
|
require('auth.php');
|
|
|
|
if(!isset($_POST['domain'], $_POST['list'], $_POST['token'])) {
|
|
log_and_die("Missing POST variables");
|
|
}
|
|
|
|
check_cors();
|
|
check_csrf($_POST['token']);
|
|
check_domain();
|
|
|
|
switch($_POST['list']) {
|
|
case "white":
|
|
exec("sudo pihole -w -q -d ${_POST['domain']}");
|
|
break;
|
|
case "black":
|
|
exec("sudo pihole -b -q -d ${_POST['domain']}");
|
|
break;
|
|
}
|
|
|
|
?>
|