diff --git a/api.php b/api.php index 9a48d158..cb6cbcb2 100644 --- a/api.php +++ b/api.php @@ -1,18 +1,21 @@ "enabled" + )); + } + + if (isset($_GET['disable']) && $auth) { + exec('sudo pihole disable'); + $data = array_merge($data, Array( + "status" => "disabled" + )); + } + function filterArray(&$a) { $sanArray = array(); foreach ($a as $k=>$v) { diff --git a/header.php b/header.php index 8c67db6c..a262a809 100644 --- a/header.php +++ b/header.php @@ -4,16 +4,6 @@ check_cors(); - if (isset($_GET['enable']) && $auth) { - exec('sudo pihole enable'); - $refer = $_SERVER['HTTP_REFERER']; - header("location:$refer"); - } elseif (isset($_GET['disable']) && $auth) { - exec('sudo pihole disable'); - $refer = $_SERVER['HTTP_REFERER']; - header("location:$refer"); - } - // Web based change of temperature unit if (isset($_GET['tempunit'])) { @@ -193,11 +183,11 @@ Active'; + echo ' Active'; } elseif ($pistatus == "0") { - echo ' Offline'; + echo ' Offline'; } else { - echo ' Starting'; + echo ' Starting'; } // CPU Temp @@ -285,9 +275,9 @@ Disable'; + echo '