diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-03-30 00:37:45 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-03-30 00:38:36 +0000 |
commit | a55e9c701c2fc8914e0aebf12e37038f59b07cf8 (patch) | |
tree | 05b5a1bc85f8742706649429ec164f576d240975 /etc/inc/captiveportal.inc | |
parent | cc460ee980e427bf4acdb8a4903e3278df59ea94 (diff) | |
download | pfsense-a55e9c701c2fc8914e0aebf12e37038f59b07cf8.zip pfsense-a55e9c701c2fc8914e0aebf12e37038f59b07cf8.tar.gz |
* Hide interfaces internals to other code and use the propper interfaces.
Basically use get_interface*() functions instead of accessing fields like 'ipaddr'/'descr' etc...
* Make get_interfaces_with_gateway less heavyweight by getting information from the configuration stored in config.xml
* Some other missed custom interface list building and substituing with propper get_configured_interface*()
NOTE: This should give indipendce on dynamic interfaces on some services that before could not be used on top of this type of interfaces.
Diffstat (limited to 'etc/inc/captiveportal.inc')
-rw-r--r-- | etc/inc/captiveportal.inc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 4228db6..deda563 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -294,9 +294,9 @@ function captiveportal_rules_generate() { global $config, $g; $cpifn = $config['captiveportal']['interface']; - $cpif = $config['interfaces'][$cpifn]['if']; - $cpip = $config['interfaces'][$cpifn]['ipaddr']; - $lanip = $config['interfaces']['lan']['ipaddr']; + $cpif = get_real_interface($cpifn); + $cpip = get_interface_ip($cpifn); + $lanip = get_interface_ip("lan"); /* note: the captive portal daemon inserts all pass rules for authenticated clients as skipto 50000 rules to make traffic shaping work */ @@ -307,16 +307,12 @@ function captiveportal_rules_generate() { /* allow nat redirects to work see http://cvstrac.pfsense.com/tktview?tn=651 */ - - $captive_portal_interface = strtoupper($cpifn); - /* if list */ $iflist = get_configured_interface_list(); - foreach ($iflist as $ifent => $ifname) { - if($captive_portal_interface == strtoupper($ifname)) + if($cpifn == $ifname) continue; - $int = convert_friendly_interface_to_real_interface_name($ifname); + $int = get_real_interface($ifname); $cprules .= "add 30 set 1 skipto 50000 all from any to any in via {$int} keep-state\n"; } |