diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-03-02 20:19:05 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-03-02 20:19:35 +0000 |
commit | cc686d98fe3b7c1c34ccb97a9b30a57bfc2ab96e (patch) | |
tree | 61c6c6fe10a81f52b997f82697190a547295672a /etc/inc | |
parent | f4a4d91ef2aa846d525d95379fd40acfde45ceb2 (diff) | |
download | pfsense-cc686d98fe3b7c1c34ccb97a9b30a57bfc2ab96e.zip pfsense-cc686d98fe3b7c1c34ccb97a9b30a57bfc2ab96e.tar.gz |
Add the neccesary foo for radius.inc to work.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/auth.inc | 2 | ||||
-rwxr-xr-x | etc/inc/openvpn.auth-user.php | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 8ae6003..6dd1c5c 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -1002,7 +1002,7 @@ function radius_backed($username, $passwd, $authcfg = NULL){ foreach ($radiusservers as $radsrv) $rauth->addServer($radsrv['ipaddr'], $radsrv['port'], $radsrv['sharedsecret']); - if (!$rauth->start()) { + if (PEAR::iserError($rauth->start())) { $retvalue['auth_val'] = 1; $retvalue['error'] = $rauth->getError(); if ($debug) diff --git a/etc/inc/openvpn.auth-user.php b/etc/inc/openvpn.auth-user.php index 2e94519..a611f8c 100755 --- a/etc/inc/openvpn.auth-user.php +++ b/etc/inc/openvpn.auth-user.php @@ -42,8 +42,43 @@ */ require_once("config.inc"); +require_once("radius.inc"); require_once("auth.inc"); +require_once("interfaces.inc"); +/** + * Get the NAS-Identifier + * + * We will use our local hostname to make up the nas_id + */ +if (!function_exists("getNasID")) { +function getNasID() +{ + global $g; + + $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 + * + */ +if (!function_exists("getNasIP")) { +function getNasIP() +{ + $nasIp = get_interface_ip(); + if(!$nasIp) + $nasIp = "0.0.0.0"; + return $nasIp; +} +} /* setup syslog logging */ openlog("openvpn", LOG_ODELAY, LOG_AUTH); |