diff options
author | Michael Newton <miken32@gmail.com> | 2013-02-11 11:00:01 -0800 |
---|---|---|
committer | Michael Newton <miken32@gmail.com> | 2013-02-11 11:00:01 -0800 |
commit | 07c132f90adfbbbbfd152d5d7b14e31d9df190d0 (patch) | |
tree | e5ce403cde3cebee2d9a37051156265f910401dd | |
parent | eb1627906a3c4bd3db1a2baa2a0ebd421c0d8bd5 (diff) | |
download | pfsense-07c132f90adfbbbbfd152d5d7b14e31d9df190d0.zip pfsense-07c132f90adfbbbbfd152d5d7b14e31d9df190d0.tar.gz |
check for configured NAS ID otherwise use default hostname
-rw-r--r-- | etc/inc/radius.inc | 17 |
1 files 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); } |