mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 02:39:25 +01:00
Move PHP scripts to scripts folder
This commit is contained in:
21
scripts/pi-hole/php/sub.php
Normal file
21
scripts/pi-hole/php/sub.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user