This commit is contained in:
billz
2020-03-26 19:45:39 +00:00
parent 6f503d8b53
commit ae26f948a4
7 changed files with 147 additions and 0 deletions

35
includes/adblock.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
require_once 'includes/status_messages.php';
require_once 'app/lib/system.php';
require_once 'config.php';
/**
*
*
*/
function DisplayAdBlockConfig()
{
$status = new StatusMessages();
$system = new System();
exec('pidof dnsmasq | wc -l', $dnsmasq);
$dnsmasq_state = ($dnsmasq[0] > 0);
$serviceStatus = $dnsmasq_state ? "up" : "down";
echo renderTemplate(
"adblock", compact(
"status",
"serviceStatus"
)
);
}
/**
* BZ: todo
*
*/
function SaveAdBlockConfig()
{
}

View File

@@ -31,6 +31,7 @@ $defaults = [
'RASPI_HOTSPOT_ENABLED' => true,
'RASPI_NETWORK_ENABLED' => true,
'RASPI_DHCP_ENABLED' => true,
'RASPI_ADBLOCK_ENABLED' => true,
'RASPI_OPENVPN_ENABLED' => false,
'RASPI_TORPROXY_ENABLED' => false,
'RASPI_CONFAUTH_ENABLED' => true,

View File

@@ -352,6 +352,12 @@ function dnsServers()
return (array) $data;
}
function blocklistProviders()
{
$data = json_decode(file_get_contents("./config/blocklists.json"));
return (array) $data;
}
function optionsForSelect($options)
{
$html = "";