summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-09-14 17:16:26 +0000
committerErmal Luçi <eri@pfsense.org>2009-09-14 17:16:26 +0000
commit40b48c6cd486efddf88a805efeb42e3181fd93bc (patch)
tree387237103ee025da1fcdd43ea267e1c2b7262b21 /usr/local
parent89a31c7e103992a812d3ef231826758ade6b79f1 (diff)
downloadpfsense-40b48c6cd486efddf88a805efeb42e3181fd93bc.zip
pfsense-40b48c6cd486efddf88a805efeb42e3181fd93bc.tar.gz
Fix multiple radius server handling.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/captiveportal/index.php6
-rw-r--r--usr/local/captiveportal/radius_accounting.inc23
2 files changed, 15 insertions, 14 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
index 2e59f03..af6f867 100755
--- a/usr/local/captiveportal/index.php
+++ b/usr/local/captiveportal/index.php
@@ -352,13 +352,11 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
$attributes['idle_timeout'],
$attributes['session_terminate_time']);
- if (isset($config['captiveportal']['radacct_enable']) && isset($radiusservers[0])) {
+ if (isset($config['captiveportal']['radacct_enable']) && !empty($radiusservers)) {
$acct_val = RADIUS_ACCOUNTING_START($ruleno,
$username,
$sessionid,
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$clientip,
$clientmac);
diff --git a/usr/local/captiveportal/radius_accounting.inc b/usr/local/captiveportal/radius_accounting.inc
index c4df029..aea05c8 100644
--- a/usr/local/captiveportal/radius_accounting.inc
+++ b/usr/local/captiveportal/radius_accounting.inc
@@ -47,7 +47,7 @@ RADIUS ACCOUNTING START
-----------------------
*/
-function RADIUS_ACCOUNTING_START($ruleno,$username,$sessionid,$radiusip,$radiusport,$radiuskey,$clientip,$clientmac) {
+function RADIUS_ACCOUNTING_START($ruleno, $username, $sessionid, $radiusservers, $clientip, $clientmac) {
global $config;
@@ -85,7 +85,15 @@ function RADIUS_ACCOUNTING_START($ruleno,$username,$sessionid,$radiusip,$radiusp
// Construct data package
$racct->username = $username;
- $racct->addServer($radiusip, $radiusport, $radiuskey);
+ /*
+ Add support for more then one radiusserver.
+ At most 10 servers may be specified.
+ When multiple servers are given, they are tried in round-robin fashion until a valid response is received
+ */
+ foreach ($radiusservers as $radsrv) {
+ // Add a new server to our instance
+ $racct->addServer($radsrv['ipaddr'], $radsrv['acctport'], $radsrv['key']);
+ }
if (PEAR::isError($racct->start())) {
$retvalue['acct_val'] = 1;
@@ -150,7 +158,7 @@ RADIUS ACCOUNTING STOP/UPDATE
-----------------------------
*/
-function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radiusip,$radiusport,$radiuskey,$clientip,$clientmac, $term_cause = 1, $interimupdate=false,$stop_time = null) {
+function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radiusservers,$clientip,$clientmac, $term_cause = 1, $interimupdate=false,$stop_time = null) {
global $config;
@@ -186,25 +194,20 @@ function RADIUS_ACCOUNTING_STOP($ruleno,$username,$sessionid,$start_time,$radius
$racct = new Auth_RADIUS_Acct_Stop;
/*
- * Currently disabled
Add support for more then one radiusserver.
At most 10 servers may be specified.
When multiple servers are given, they are tried in round-robin fashion until a valid response is received
-
+ */
foreach ($radiusservers as $radsrv) {
-
// Add a new server to our instance
- $racct->addServer($radsrv['ipaddr'], $radsrv['port'], $radsrv['key']);
-
+ $racct->addServer($radsrv['ipaddr'], $radsrv['acctport'], $radsrv['key']);
}
- */
// See RADIUS_ACCOUNTING_START for info
$racct->authentic = RADIUS_AUTH_RADIUS;
// Construct data package
$racct->username = $username;
- $racct->addServer($radiusip, $radiusport, $radiuskey);
// Set session_time
$racct->session_time = $session_time;
OpenPOWER on IntegriCloud