aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/dnsblacklist/dnsblacklist.tmp26
-rw-r--r--config/dnsblacklist/dnsblacklist.xml2
-rwxr-xr-xpkg_config.7.xml2
3 files changed, 21 insertions, 9 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>
diff --git a/pkg_config.7.xml b/pkg_config.7.xml
index d88714c0..45b41313 100755
--- a/pkg_config.7.xml
+++ b/pkg_config.7.xml
@@ -238,7 +238,7 @@
<pkginfolink></pkginfolink>
<config_file>http://www.pfsense.com/packages/config/dnsblacklist/dnsblacklist.xml</config_file>
<depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.2.3</version>
+ <version>0.2.4</version>
<status>Beta</status>
<required_version>1.2.2</required_version>
<maintainer>markjcrane@gmail.com</maintainer>