diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-09-27 10:25:29 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-09-28 10:16:42 -0300 |
commit | 8ad84ebb49f86e791427110233382bd5e804d503 (patch) | |
tree | 955689e9f7547c8c0abe5698d3404b16504afc7f /usr/local | |
parent | 0bb7bfbbd9f0881a6d1970540068c707f4feb69f (diff) | |
download | pfsense-8ad84ebb49f86e791427110233382bd5e804d503.zip pfsense-8ad84ebb49f86e791427110233382bd5e804d503.tar.gz |
Remove redundant copies of getNasIP(), it should fix #3234
Diffstat (limited to 'usr/local')
-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; |