summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr/local/captiveportal/radius_accounting.inc29
-rw-r--r--usr/local/captiveportal/radius_authentication.inc29
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;
OpenPOWER on IntegriCloud