diff options
author | Ermal <eri@pfsense.org> | 2010-03-12 13:03:13 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-03-12 13:03:57 +0000 |
commit | 69677d62c5a80e66a6497ed02d0133a84ced0433 (patch) | |
tree | 28a11072c5efdbfabc9059e89388c8a4a311ac2e | |
parent | 6f76920c94c2299240112b3ce9bd3238b9726989 (diff) | |
download | pfsense-69677d62c5a80e66a6497ed02d0133a84ced0433.zip pfsense-69677d62c5a80e66a6497ed02d0133a84ced0433.tar.gz |
Do not require the caller to define getNasIP explicitly, intead try to gracefully handle the case.
-rw-r--r-- | etc/inc/radius.inc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/etc/inc/radius.inc b/etc/inc/radius.inc index bcf7342..77535de 100644 --- a/etc/inc/radius.inc +++ b/etc/inc/radius.inc @@ -296,13 +296,21 @@ class Auth_RADIUS extends PEAR { */ function putStandardAttributes() { + global $g; + 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, getNasIP(), "addr"); + $this->putAttribute(RADIUS_NAS_IP_ADDRESS, $ipaddr, "addr"); // Add support for sending NAS-Identifier - $this->putAttribute(RADIUS_NAS_IDENTIFIER, getNasID()); - + $nasId = ""; + exec("/bin/hostname", $nasId); + if(!$nasId[0]) + $nasId[0] = "{$g['product_name']}"; + $this->putAttribute(RADIUS_NAS_IDENTIFIER, $nasId[0]); } /** |