* Create a AcctUniqueId before adding a row in radacct in log_badlogins.
* Use Max-Monthly-Session not Max-Weekly-Session for the monthly limit
* When checking the weekly limit check first that $remaining is numeric before doing any comparisons
+* Add a usage_summary parameter in user_finger. If it is passed then we only output a text like:
+ "Online: <num> Free: <num>" which can be used in outside pages
Ver 1.62:
* Remove one sql query from user_admin which was not needed.
* Instead of a query like "LIKE 'YYYY-MM-DD%'" use "AcctStopTime >= 'YYYY-MM-DD 00:00:00 AND AcctStopTime
htdocs:: user_finger.php3 =>
It will finger the nas(es) and show the logged in users. If an argument server is passed then
it will only show users for the specific access server.
+ If an argument usage_summary is passed then it will only show a line like:
+ "Online: <num> Free: <num>" which can be used by other pages
html:: Contains the html code for a few pages
html::user_admin.html.php3 =>
<?php
require('../conf/config.php3');
-?>
+if (!isset($usage_summary)){
+ echo <<<EOM
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="50">
<title>User Finger Facility</title>
<link rel="stylesheet" href="style.css">
</head>
+EOM;
+}
-<?php
if ($config[general_decode_normal_attributes] == 'yes'){
if (is_file("../lib/lang/$config[general_prefered_lang]/utf8.php3"))
include_once("../lib/lang/$config[general_prefered_lang]/utf8.php3");
$link = @da_sql_pconnect($config);
$link2 = connect2db($config);
+$tot_in = $tot_rem = 0;
if ($link){
$h = 21;
$servers_num = 0;
}
$server_loggedin[$servers_num] = $num;
$server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown';
+ $tot_in += $num;
+ if (is_numeric($server_rem[$servers_num]))
+ $tot_rem += $server_rem[$servers_num];
}
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
+if (isset($usage_summary)){
+ echo "Online: $tot_in Free: $tot_rem\n";
+ exit();
+}
?>
<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">