summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2011-01-25 11:35:33 -0500
committerScott Ullrich <sullrich@pfsense.org>2011-01-25 11:35:33 -0500
commitf23a6091d4c9142b0821f276f93cb4fba80ef63d (patch)
tree325ccaa59821d0ff4fa28d6b504ce3484d7b7db9 /etc/inc
parent5060dea773473ee68064db96f24666251fcfb66e (diff)
downloadpfsense-f23a6091d4c9142b0821f276f93cb4fba80ef63d.zip
pfsense-f23a6091d4c9142b0821f276f93cb4fba80ef63d.tar.gz
Fix formatting. Die, VIM, DIE!
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/captiveportal.inc31
1 files changed, 31 insertions, 0 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 70073e7..50ddf90 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1041,6 +1041,37 @@ function captiveportal_allowedip_configure_entry($ipent) {
return $rules;
}
+/*
+ Adds a dnsfilter entry and watches for hostname changes.
+ A change results in reloading the ruleset.
+*/
+function setup_dnsfilter_entries($hostname) {
+ $cp_filterdns_filename = "{$g['varetc_path']}/filterdns-captiveportal.conf";
+ $fd = fopen($cp_filterdns_filename, "w");
+ if (is_array($config['captiveportal']['allowedhostname']))
+ foreach ($config['captiveportal']['allowedhostname'] as $hostnameent)
+ fwrite($fd, $hostnameent . "\n");
+ fclose($fd);
+ killbypid("{$g['tmp_path']}/dnswatch-cpah.pid");
+ mwexec("/usr/local/sbin/dnswatch {$g['tmp_path']}/dnswatch-cpah.pid 300 '/etc/rc.filter_configure_sync' {$g['varetc_path']}/dnswatch-captiveportal.conf");
+}
+
+function captiveportal_allowedhostname_configure_entry($ipent) {
+
+}
+
+function captiveportal_allowedhostname_configure() {
+ global $config, $g;
+
+ $rules = "";
+ setup_dnsfilter_entries();
+ if (is_array($config['captiveportal']['allowedhostname']))
+ foreach ($config['captiveportal']['allowedhostname'] as $hostnameent)
+ $rules .= captiveportal_allowedip_configure_entry($hostnameent);
+
+ return $rules;
+}
+
function captiveportal_allowedip_configure() {
global $config, $g;
OpenPOWER on IntegriCloud