mirror of
https://github.com/pi-hole/web.git
synced 2026-05-08 09:39:05 +01:00
Merge branch 'devel' into restructureFolders
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
<?php
|
||||
require('auth.php');
|
||||
|
||||
if(!isset($_POST['domain'], $_POST['list'], $_POST['token'])) {
|
||||
log_and_die("Missing POST variables");
|
||||
}
|
||||
$type = $_POST['list'];
|
||||
|
||||
check_cors();
|
||||
check_csrf($_POST['token']);
|
||||
check_domain();
|
||||
// All of the verification for list editing
|
||||
list_verify($type);
|
||||
|
||||
switch($_POST['list']) {
|
||||
switch($type) {
|
||||
case "white":
|
||||
echo exec("sudo pihole -w -q ${_POST['domain']}");
|
||||
break;
|
||||
|
||||
@@ -105,4 +105,33 @@ function check_domain() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function list_verify($type) {
|
||||
if(!isset($_POST['domain']) || !isset($_POST['list']) || !(isset($_POST['pw']) || isset($_POST['token']))) {
|
||||
log_and_die("Missing POST variables");
|
||||
}
|
||||
|
||||
if(isset($_POST['token']))
|
||||
{
|
||||
check_cors();
|
||||
check_csrf($_POST['token']);
|
||||
}
|
||||
elseif(isset($_POST['pw']))
|
||||
{
|
||||
require("password.php");
|
||||
if(strlen($pwhash) == 0)
|
||||
{
|
||||
log_and_die("No password set - ${type}listing with password not supported");
|
||||
}
|
||||
elseif($wrongpassword)
|
||||
{
|
||||
log_and_die("Wrong password - ${type}listing of ${_POST['domain']} not permitted");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
log_and_die("Not allowed!");
|
||||
}
|
||||
check_domain();
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
<?php
|
||||
require('auth.php');
|
||||
|
||||
if(!isset($_POST['domain'], $_POST['list'], $_POST['token'])) {
|
||||
log_and_die("Missing POST variables");
|
||||
}
|
||||
$type = $_POST['list'];
|
||||
|
||||
check_cors();
|
||||
check_csrf($_POST['token']);
|
||||
check_domain();
|
||||
// All of the verification for list editing
|
||||
list_verify($type);
|
||||
|
||||
switch($_POST['list']) {
|
||||
switch($type) {
|
||||
case "white":
|
||||
exec("sudo pihole -w -q -d ${_POST['domain']}");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user