$cpdb[$i][4], // username
$cpdb[$i][5], // sessionid
$cpdb[$i][0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$cpdb[$i][2], // clientip
$cpdb[$i][3], // clientmac
13); // Port Preempted
$cpdb[$i][4], // username
$cpdb[$i][5], // sessionid
$cpdb[$i][0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$cpdb[$i][2], // clientip
$cpdb[$i][3], // clientmac
$term_cause);
-----------------------
*/
-function RADIUS_ACCOUNTING_START($ruleno,$username,$sessionid,$radiusip,$radiusport,$radiuskey,$clientip,$clientmac) {
+function RADIUS_ACCOUNTING_START($ruleno,$username,$sessionid,$radiusservers,$clientip,$clientmac) {
global $config;
// Create our instance
$racct = new Auth_RADIUS_Acct_Start;
+ // Initialise our server
+ foreach ($radiusservers as $radsrv) {
+
+ // Add a new server to our instance
+ $racct->addServer($radsrv['ipaddr'], $radsrv['port'], $radsrv['key']);
+
+ }
+
/* Different Authentication options
*
* Its possible todo other authentication methods but still do radius accounting
// Construct data package
$racct->username = $username;
- $racct->addServer($radiusip, $radiusport, $radiuskey);
if (PEAR::isError($racct->start())) {
$retvalue['acct_val'] = 1;
$racct->close();
return $retvalue;
- /* Old code:
- * $status = $racct->start();
- * if(PEAR::isError($status)) {
- * if ($debug)
- * printf("Radius start: %s<br>\n", $status->getMessage());
- * exit;
- * }
- */
}
/*
-----------------------------
*/
-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;
else
$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
-
+ // Initialise our server
foreach ($radiusservers as $radsrv) {
// Add a new server to our instance
$racct->addServer($radsrv['ipaddr'], $radsrv['port'], $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;
$cpdb[$i][4], // username
$cpdb[$i][5], // sessionid
$cpdb[$i][0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$cpdb[$i][2], // clientip
$cpdb[$i][3], // clientmac
10); // NAS Request
RADIUS_ACCOUNTING_START($cpdb[$i][1], // ruleno
$cpdb[$i][4], // username
$cpdb[$i][5], // sessionid
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$cpdb[$i][2], // clientip
$cpdb[$i][3]); // clientmac
} else if ($config['captiveportal']['reauthenticateacct'] == "interimupdate") {
$cpdb[$i][4], // username
$cpdb[$i][5], // sessionid
$cpdb[$i][0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$cpdb[$i][2], // clientip
$cpdb[$i][3], // clientmac
10, // NAS Request
$dbent[4], // username
$dbent[5], // sessionid
$dbent[0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$dbent[2], // clientip
$dbent[3], // clientmac
$term_cause, // Acct-Terminate-Cause
$cpdb[$i][4], // username
$cpdb[$i][5], // sessionid
$cpdb[$i][0], // start time
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$cpdb[$i][2], // clientip
$cpdb[$i][3], // clientmac
7); // Admin Reboot
$auth_list['acct_val'] = RADIUS_ACCOUNTING_START($ruleno,
$username,
$sessionid,
- $radiusservers[0]['ipaddr'],
- $radiusservers[0]['acctport'],
- $radiusservers[0]['key'],
+ $radiusservers,
$clientip,
$clientmac);
if ($auth_list['acct_val'] == 1)
<td class="vncell"> </td>
<td class="vtable"><input name="radacct_enable" type="checkbox" id="radacct_enable" value="yes" onClick="enable_change(false)" <?php if($pconfig['radacct_enable']) echo "checked"; ?>>
<strong>send RADIUS accounting packets</strong><br>
- If this is enabled, RADIUS accounting packets will be sent to the primary RADIUS server.</td>
+ If this is enabled, RADIUS accounting packets will be sent to the RADIUS server(s).</td>
</tr>
<tr>
<td class="vncell" valign="top">Accounting port</td>