summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc14
-rw-r--r--etc/inc/radius.inc17
2 files changed, 11 insertions, 20 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index d090f1b..0872b46 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1516,20 +1516,6 @@ function getVolume($ip) {
}
/**
- * Get the NAS-Identifier
- *
- * We will use our local hostname to make up the nas_id
- */
-function getNasID()
-{
- $nasId = "";
- exec("/bin/hostname", $nasId);
- if(!$nasId[0])
- $nasId[0] = "{$g['product_name']}";
- return $nasId[0];
-}
-
-/**
* Get the NAS-IP-Address based on the current wan address
*
* Use functions in interfaces.inc to find this out
diff --git a/etc/inc/radius.inc b/etc/inc/radius.inc
index 6aa6cfe..3039043 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["captiveportal"][$cpzone]["radiusnasid"])) {
+ $nasId = php_uname("n");
+ } else {
+ $nasId = $config["captiveportal"][$cpzone]["radiusnasid"];
+ }
$this->putAttribute(RADIUS_NAS_IDENTIFIER, $nasId);
}
OpenPOWER on IntegriCloud