From 07c132f90adfbbbbfd152d5d7b14e31d9df190d0 Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Mon, 11 Feb 2013 11:00:01 -0800 Subject: check for configured NAS ID otherwise use default hostname --- etc/inc/radius.inc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/etc/inc/radius.inc b/etc/inc/radius.inc index 6aa6cfe..ee3cd5f 100644 --- a/etc/inc/radius.inc +++ b/etc/inc/radius.inc @@ -296,17 +296,22 @@ class Auth_RADIUS extends PEAR { */ function putStandardAttributes() { - global $g; + global $config, $cpzone; - if (!function_exists("getNasIp")) - $ipaddr = "0.0.0.0"; - else - $ipaddr = getNasIP(); + if (!function_exists("getNasIp")) { + $ipaddr = "0.0.0.0"; + } else { + $ipaddr = getNasIP(); + } // Add support for sending NAS-IP-Address, set this explicitly as an ip_addr $this->putAttribute(RADIUS_NAS_IP_ADDRESS, $ipaddr, "addr"); // Add support for sending NAS-Identifier - $nasId = php_uname("n"); + if (empty($config[$cpzone]["radiusnasid"])) { + $nasId = php_uname("n"); + } else { + $nasId = $config[$cpzone]["radiusnasid"]; + } $this->putAttribute(RADIUS_NAS_IDENTIFIER, $nasId); } -- cgit v1.1