From 64c0462becb942f92e65e71eb0bbac1b797994a2 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 17 Jun 2010 21:57:39 +0000 Subject: Teach even getNasIP for the new callingstation ip setting. --- etc/inc/captiveportal.inc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'etc/inc/captiveportal.inc') diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 83d8b31..be3c831 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1248,10 +1248,17 @@ function getNasID() function getNasIP() { - $nasIp = get_interface_ip(); - if(!$nasIp) - $nasIp = "0.0.0.0"; - return $nasIp; + global $config; + + if (!empty($config['captiveportal']['radiussrcip_attribute'])) + $nasIp = get_interface_ip($config['captiveportal']['radiussrcip_attribute']); + else + $nasIp = get_interface_ip(); + + if(!is_ipaddr($nasIp)) + $nasIp = "0.0.0.0"; + + return $nasIp; } function portal_ip_from_client_ip($cliip) { @@ -1278,4 +1285,4 @@ function portal_ip_from_client_ip($cliip) { return false; } -?> \ No newline at end of file +?> -- cgit v1.1