diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-09-27 10:25:29 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-09-27 10:25:39 -0300 |
commit | f58bfb932acf9924546d3b9a2c77899741adeb9a (patch) | |
tree | 24612d8fdd15f81986bbb14cd1e8f82e18515557 /usr | |
parent | 65fec80dbbdd7eff492adfad453a22805d96f9a5 (diff) | |
download | pfsense-f58bfb932acf9924546d3b9a2c77899741adeb9a.zip pfsense-f58bfb932acf9924546d3b9a2c77899741adeb9a.tar.gz |
Remove redundant copies of getNasIP(), it should fix #3234
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/captiveportal/radius_accounting.inc | 29 | ||||
-rw-r--r-- | usr/local/captiveportal/radius_authentication.inc | 29 |
2 files changed, 4 insertions, 54 deletions
diff --git a/usr/local/captiveportal/radius_accounting.inc b/usr/local/captiveportal/radius_accounting.inc index e43a188..d2b4d50 100644 --- a/usr/local/captiveportal/radius_accounting.inc +++ b/usr/local/captiveportal/radius_accounting.inc @@ -44,33 +44,6 @@ define('GIGAWORDS_RIGHT_OPERAND', '4294967296'); // 2^32 -/** - * Get the NAS-IP-Address based on the current wan address - * - * Use functions in interfaces.inc to find this out - * - */ -if (!function_exists('getNasIP')) { - function getNasIP() - { - global $config, $cpzone; - - if (empty($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) { - $nasIp = get_interface_ip(); - } else { - if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) - $nasIp = $config['captiveportal'][$cpzone]['radiussrcip_attribute']; - else - $nasIp = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']); - } - - if(!is_ipaddr($nasIp)) - $nasIp = "0.0.0.0"; - - return $nasIp; - } -} - /* RADIUS ACCOUNTING START ----------------------- @@ -96,6 +69,8 @@ function RADIUS_ACCOUNTING_START($ruleno, $username, $sessionid, $radiusservers, break; default: + if (!function_exists('getNasIP')) + require_once("captiveportal.inc"); $calledstationid = getNasIP(); $callingstationid = $clientmac; break; diff --git a/usr/local/captiveportal/radius_authentication.inc b/usr/local/captiveportal/radius_authentication.inc index 8727815..5f24506 100644 --- a/usr/local/captiveportal/radius_authentication.inc +++ b/usr/local/captiveportal/radius_authentication.inc @@ -41,33 +41,6 @@ pfSense_MODULE: captiveportal */ -/** - * Get the NAS-IP-Address based on the current wan address - * - * Use functions in interfaces.inc to find this out - * - */ -if (!function_exists('getNasIP')) { - function getNasIP() - { - global $config, $cpzone; - - if (empty($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) { - $nasIp = get_interface_ip(); - } else { - if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) - $nasIp = $config['captiveportal'][$cpzone]['radiussrcip_attribute']; - else - $nasIp = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']); - } - - if(!is_ipaddr($nasIp)) - $nasIp = "0.0.0.0"; - - return $nasIp; - } -} - /* RADIUS AUTHENTICATION --------------------- @@ -95,6 +68,8 @@ function RADIUS_AUTHENTICATION($username,$password,$radiusservers,$clientip,$cli $callingstationid = $clientip; break; default: + if (!function_exists('getNasIP')) + require_once("captiveportal.inc"); $calledstationid = getNasIP(); $callingstationid = $clientmac; break; |