aboutsummaryrefslogtreecommitdiffstats
path: root/config/dnsblacklist
diff options
context:
space:
mode:
Diffstat (limited to 'config/dnsblacklist')
-rw-r--r--config/dnsblacklist/dnsblacklist.tmp26
-rw-r--r--config/dnsblacklist/dnsblacklist.xml2
2 files changed, 20 insertions, 8 deletions
diff --git a/config/dnsblacklist/dnsblacklist.tmp b/config/dnsblacklist/dnsblacklist.tmp
index a6d67bb1..a00bdb82 100644
--- a/config/dnsblacklist/dnsblacklist.tmp
+++ b/config/dnsblacklist/dnsblacklist.tmp
@@ -61,10 +61,21 @@ if (count($_POST)>0) {
$targetfile = "/usr/local/etc/dnsmasq.blacklist.conf";
$includestring = "conf-file=/usr/local/etc/dnsmasq.blacklist.conf";
$dnsmasqconf = "/usr/local/etc/dnsmasq.conf";
+
//clear previous values
+ $ent = array();
foreach($category as $key => $value) {
- $config['installedpackages']['dnsblacklist']['config'][0][$key] = '';
+ $ent[$key] = '0';
+ }
+ $config['installedpackages']['dnsblacklist']['config'][0] = $ent;
+ //write_config();
+
+ //truncate the dnsmasq.blacklist.conf file
+ if (file_exists($targetfile)) {
+ $fh = fopen($targetfile, 'w');
+ fclose($fh);
}
+
if ($_POST['enable'] == 1) {
//echo "enabled";
$config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 1;
@@ -73,6 +84,7 @@ if (count($_POST)>0) {
//echo "disabled";
$config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 0;
}
+
//add the include entry for dnsmasq.blacklist.conf to dnsmasq.conf
if (file_exists($dnsmasqfile)) {
$getdnsmasq = file_get_contents($dnsmasqfile);
@@ -90,11 +102,7 @@ if (count($_POST)>0) {
fwrite($my2fhandle, $includestring);
fclose($my2fhandle);
}
- //truncate the dnsmasq.blacklist.conf file
- if (file_exists($targetfile)) {
- $fh = fopen($targetfile, 'w');
- fclose($fh);
- }
+
//build the dnsmasq.blacklist.conf
if (count($_POST["blacklist"]) > 0) {
foreach($_POST["blacklist"] as $value) {
@@ -116,6 +124,7 @@ if (count($_POST)>0) {
}
}
}
+
write_config();
services_dnsmasq_configure();
sleep(1);
@@ -192,7 +201,10 @@ Select a category to edit:
<br />
<br />
-->
-
+<?php
+ //This input guarantees that a POST is sent even if no category is selected.
+ echo "<input type='hidden' name='zzz' value='required'>";
+?>
<input type="submit" value="Save">
</td>
</tr>
diff --git a/config/dnsblacklist/dnsblacklist.xml b/config/dnsblacklist/dnsblacklist.xml
index 3e8c1667..2f3e2996 100644
--- a/config/dnsblacklist/dnsblacklist.xml
+++ b/config/dnsblacklist/dnsblacklist.xml
@@ -41,7 +41,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>DNS Blacklist Settings</name>
- <version>0.2.3</version>
+ <version>0.2.4</version>
<title>Settings</title>
<include_file>/usr/local/pkg/dnsblacklist.inc</include_file>
<menu>