diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-01-25 11:35:33 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-01-25 11:35:33 -0500 |
commit | f23a6091d4c9142b0821f276f93cb4fba80ef63d (patch) | |
tree | 325ccaa59821d0ff4fa28d6b504ce3484d7b7db9 /etc | |
parent | 5060dea773473ee68064db96f24666251fcfb66e (diff) | |
download | pfsense-f23a6091d4c9142b0821f276f93cb4fba80ef63d.zip pfsense-f23a6091d4c9142b0821f276f93cb4fba80ef63d.tar.gz |
Fix formatting. Die, VIM, DIE!
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/captiveportal.inc | 31 |
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; |