return $volume;
}
+/**
+ * Get the NAS-Identifier
+ *
+ * We will use our local hostname to make up the nas_id
+ */
+
+function getNasID()
+{
+ exec("/bin/hostname", $_nasId);
+ if(!$nasId[0])
+ $nasId[0] = "m0n0wall";
+ return $nasId[0];
+}
+
+/**
+ * Get the NAS-IP-Address based on the current wan address
+ *
+ * Use functions in interfaces.inc to find this out
+ *
+ */
+
+function getNasIP()
+{
+ $nasIp = get_current_wan_address();
+ if(!$nasIp)
+ $nasIp = "0.0.0.0";
+ return $nasIp;
+}
?>
*/
var $password = null;
- /**
- * NAS-IP-Address
- * @var string
- */
- var $nasIp = null;
-
- /**
- * NAS-Identifier
- * @var array (note: RFC specifies string and PECL specifies integer)
- */
- var $nasId = array();
-
/**
* List of known attributes.
* @var array
$this->_servers[] = array($servername, $port, $sharedSecret, $timeout, $maxtries);
}
- /**
- * Get the NAS-Identifier
- *
- * We will use our local hostname to make up the nas_id
- */
- function getNasID()
- {
- exec("/bin/hostname", $_nasId);
- if(!$_nasId[0])
- $_nasId[0] = "m0n0wall";
- return $_nasId[0];
- }
-
- /**
- * Get the NAS-IP-Address based on the current wan address
- *
- * Use functions in interfaces.inc to find this out
- *
- */
- function getNasIP()
- {
- $_nasIp = get_current_wan_address();
- if(!$_nasIp)
- $_nasIp = "0.0.0.0";
- return $_nasIp;
- }
-
/**
* Returns an error message, if an error occurred.
*
{
return radius_strerror($this->res);
}
-
+
/**
* Sets the configuration-file.
*
$this->putAttribute(RADIUS_SERVICE_TYPE, RADIUS_LOGIN);
// Add support for sending NAS-IP-Address, set this explicitly as an ip_addr
- $this->putAttribute(RADIUS_NAS_IP_ADDRESS, $this->getNasIP(), addr);
+ $this->putAttribute(RADIUS_NAS_IP_ADDRESS, getNasIP(), addr);
// Add support for sending NAS-Identifier
- $this->putAttribute(RADIUS_NAS_IDENTIFIER, $this->getNasID());
+ $this->putAttribute(RADIUS_NAS_IDENTIFIER, getNasID());
}