projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
8c457a8
)
Count online users correctly (through a separate query) in user_finger.
author
kkalev
<kkalev>
Tue, 5 Apr 2005 13:32:23 +0000
(13:32 +0000)
committer
kkalev
<kkalev>
Tue, 5 Apr 2005 13:32:23 +0000
(13:32 +0000)
dialup_admin/Changelog
patch
|
blob
|
history
dialup_admin/htdocs/user_finger.php3
patch
|
blob
|
history
diff --git
a/dialup_admin/Changelog
b/dialup_admin/Changelog
index
c74bbdd
..
9e07b5a
100644
(file)
--- a/
dialup_admin/Changelog
+++ b/
dialup_admin/Changelog
@@
-6,6
+6,7
@@
Ver 1.80:
since the syntax is different between db vendors
* Rename the badusers date field to incidentdate to avoid reserved words in databases. Bug found by
Peter Nixon
since the syntax is different between db vendors
* Rename the badusers date field to incidentdate to avoid reserved words in databases. Bug found by
Peter Nixon
+* Count online users correctly (through a separate query) in user_finger.
Ver 1.78:
* Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB
* Add a configuration directive general_sessionclear_bin
Ver 1.78:
* Add a snmp_clearsession which can disconnect a user by using the Cisco AAA Session MIB
* Add a configuration directive general_sessionclear_bin
diff --git
a/dialup_admin/htdocs/user_finger.php3
b/dialup_admin/htdocs/user_finger.php3
index
41c6db4
..
f190c0b
100644
(file)
--- a/
dialup_admin/htdocs/user_finger.php3
+++ b/
dialup_admin/htdocs/user_finger.php3
@@
-55,6
+55,7
@@
if ($link){
if ($config[general_ld_library_path] != '')
putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
foreach($nas_list as $nas){
if ($config[general_ld_library_path] != '')
putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
foreach($nas_list as $nas){
+ $j = 0;
$num = 0;
if ($server != ''){
$num = 0;
if ($server != ''){
@@
-93,6
+94,13
@@
if ($link){
}
}
$search = @da_sql_query($link,$config,
}
}
$search = @da_sql_query($link,$config,
+ "SELECT COUNT(*) AS onlineusers FROM $config[sql_accounting_table] WHERE
+ acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query;");
+ if ($search){
+ if (($row = @da_sql_fetch_array($search,$config)))
+ $num = $row[onlineusers];
+ }
+ $search = @da_sql_query($link,$config,
"SELECT DISTINCT username,acctstarttime,framedipaddress,callingstationid
FROM $config[sql_accounting_table] WHERE
acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query
"SELECT DISTINCT username,acctstarttime,framedipaddress,callingstationid
FROM $config[sql_accounting_table] WHERE
acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query
@@
-101,19
+109,19
@@
if ($link){
if ($search){
$now = time();
while($row = @da_sql_fetch_array($search,$config)){
if ($search){
$now = time();
while($row = @da_sql_fetch_array($search,$config)){
- $
num
++;
+ $
j
++;
$h += 21;
$user = $row['username'];
$h += 21;
$user = $row['username'];
- $finger_info[$servers_num][$
num
]['ip'] = $row['framedipaddress'];
- if ($finger_info[$servers_num][$
num
]['ip'] == '')
- $finger_info[$servers_num][$
num
]['ip'] = '-';
+ $finger_info[$servers_num][$
j
]['ip'] = $row['framedipaddress'];
+ if ($finger_info[$servers_num][$
j
]['ip'] == '')
+ $finger_info[$servers_num][$
j
]['ip'] = '-';
$session_time = $row['acctstarttime'];
$session_time = date2timediv($session_time,$now);
$session_time = $row['acctstarttime'];
$session_time = date2timediv($session_time,$now);
- $finger_info[$servers_num][$
num
]['session_time'] = time2strclock($session_time);
- $finger_info[$servers_num][$
num
]['user'] = $user;
- $finger_info[$servers_num][$
num
]['callerid'] = $row['callingstationid'];
- if ($finger_info[$servers_num][$
num
]['callerid'] == '')
- $finger_info[$servers_num][$
num
]['callerid'] = '-';
+ $finger_info[$servers_num][$
j
]['session_time'] = time2strclock($session_time);
+ $finger_info[$servers_num][$
j
]['user'] = $user;
+ $finger_info[$servers_num][$
j
]['callerid'] = $row['callingstationid'];
+ if ($finger_info[$servers_num][$
j
]['callerid'] == '')
+ $finger_info[$servers_num][$
j
]['callerid'] = '-';
if ($user_info["$user"] == ''){
$user_info["$user"] = get_user_info($link2,$user,$config,$decode_normal,$k);
if ($user_info["$user"] == '' || $user_info["$user"] == ' ')
if ($user_info["$user"] == ''){
$user_info["$user"] = get_user_info($link2,$user,$config,$decode_normal,$k);
if ($user_info["$user"] == '' || $user_info["$user"] == ' ')
@@
-122,6
+130,7
@@
if ($link){
}
$height[$servers_num] = $h;
}
}
$height[$servers_num] = $h;
}
+ $server_counting[$servers_num] = $j;
$server_loggedin[$servers_num] = $num;
$server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown';
$tot_in += $num;
$server_loggedin[$servers_num] = $num;
$server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown';
$tot_in += $num;
@@
-180,7
+189,7
@@
echo <<<EOM
<th>name</th><th>duration</th>
</tr>
EOM;
<th>name</th><th>duration</th>
</tr>
EOM;
- for( $k = 1; $k <= $server_
loggedin
[$j]; $k++){
+ for( $k = 1; $k <= $server_
counting
[$j]; $k++){
$user = $finger_info[$j][$k][user];
if ($user == '')
$user = ' ';
$user = $finger_info[$j][$k][user];
if ($user == '')
$user = ' ';