merge devel

This commit is contained in:
Promofaux
2016-12-29 19:59:09 +00:00
17 changed files with 658 additions and 143 deletions

15
api.php
View File

@@ -70,7 +70,16 @@
}
elseif (isset($_GET['disable'], $_GET['token']) && $auth) {
check_csrf($_GET['token']);
exec('sudo pihole disable');
$disable = intval($_GET['disable']);
// intval returns the integer value on success, or 0 on failure
if($disable > 0)
{
exec("sudo pihole disable ".$disable."s");
}
else
{
exec('sudo pihole disable');
}
$data = array_merge($data, Array(
"status" => "disabled"
));
@@ -80,6 +89,10 @@
$data = array_merge($data, getGravity());
}
if (isset($_GET['tailLog'])) {
$data = array_merge($data, tailPiholeLog($_GET['tailLog']));
}
function filterArray(&$inArray) {
$outArray = array();
foreach ($inArray as $key=>$value) {