Enable/Disable query logging implemented

This commit is contained in:
DL6ER
2016-12-11 18:30:48 +01:00
parent db6e651c32
commit 28ca620f31
2 changed files with 24 additions and 4 deletions
+14
View File
@@ -67,6 +67,20 @@
break;
// Set query logging
case "Logging":
if($_POST["action"] === "Disable")
{
exec("sudo pihole -l off");
}
else
{
exec("sudo pihole -l on");
}
break;
default:
break;
+10 -4
View File
@@ -155,10 +155,16 @@
</div>
<div class="box-body">
<form role="form" method="post">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" <?php if($piHoleLogging) { ?>checked<?php } ?>>Enabled (recommended)</label></div>
</div>
Note that disabling will render graphs on the web user interface useless
<p>Current status: <?php if($piHoleLogging) { ?>Enabled (recommended)<?php }else{ ?>Disabled<?php } ?></p>
<input type="hidden" name="field" value="Logging">
<?php if($piHoleLogging) { ?>
<input type="hidden" name="action" value="Disable">
<button type="submit" class="btn btn-primary pull-right">Disable query logging</button>
<?php } else { ?>
<input type="hidden" name="action" value="Enable">
<button type="submit" class="btn btn-primary pull-right">Enable query logging</button>
<?php } ?>
<?php if($piHoleLogging) { ?><p>Note that disabling will render graphs on the web user interface useless</p><?php } ?>
</form>
</div>
</div>