summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-02-10 12:44:02 +0000
committerErmal <eri@pfsense.org>2013-02-11 08:20:29 +0000
commitbb58ed63a5bdf3f556022f9191a38d815f1c638d (patch)
tree4900e2ecccc56c578eabdee29467a420945c6675 /etc/inc
parentc4680ae2dada8d2230fe6eba92fc24eed4853fb4 (diff)
downloadpfsense-bb58ed63a5bdf3f556022f9191a38d815f1c638d.zip
pfsense-bb58ed63a5bdf3f556022f9191a38d815f1c638d.tar.gz
Cleanup some code
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/captiveportal.inc16
1 files changed, 6 insertions, 10 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index abdc3de..b021d6a 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -526,7 +526,7 @@ EOD;
$rulenum++;
$cprules .= "add {$rulenum} pipe tablearg ip from any to table(2) out\n";
$rulenum++;
-
+
$listenporthttp =
$config['captiveportal'][$cpzone]['listenporthttp'] ?
$config['captiveportal'][$cpzone]['listenporthttp'] :
@@ -971,18 +971,15 @@ function captiveportal_passthrumac_findbyname($username) {
*/
function captiveportal_allowedip_configure_entry($ipent, $ishostname = false) {
- /* This function can deal with hostname or ipaddress */
- if($ipent['ip'])
- $ipaddress = $ipent['ip'];
-
/* Instead of copying this entire function for something
* easy such as hostname vs ip address add this check
*/
- if(!empty($ipent['hostname'])) {
+ if ($ishostname === true) {
$ipaddress = gethostbyname($ipent['hostname']);
- if(!is_ipaddr($ipaddress))
+ if (!is_ipaddr($ipaddress))
return;
- }
+ } else
+ $ipaddress = $ipent['ip'];
$rules = "";
$cp_filterdns_conf = "";
@@ -1026,9 +1023,8 @@ function captiveportal_allowedhostname_configure() {
unset($cp_filterdns_conf);
if (isvalidpid("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid"))
sigkillbypid("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid", "HUP");
- else {
+ else
mwexec("/usr/local/sbin/filterdns -p {$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid -i 300 -c {$cp_filterdns_filename} -y {$cpzone} -d 1");
- }
} else {
killbypid("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid");
@unlink("{$g['varrun_path']}/filterdns-{$cpzone}-cpah.pid");
OpenPOWER on IntegriCloud