* Add a few more attribute help pages from Ulrich Walcher <uwalcher@bcore.de>
* Also check for $server != '' in stats.php3. Bug noted by Ulrich Walcher <uwalcher@bcore.de>
* Consider the account locked either if Dialup-Access == FALSE or if it is not set at all
+* Calculate weekly used time correctly (from Sunday 00:00:00)
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
AND AcctStartTime >= '$week_str' AND AcctStartTime <= '$now_str';");
if ($search){
$row = @da_sql_fetch_array($search,$config);
- $weekly_used = $row['sum(AcctSessionTime)'];
$tot_time = time2str($row['sum(AcctSessionTime)']);
$tot_input = bytes2str($row['sum(AcctInputOctets)']);
$tot_output = bytes2str($row['sum(AcctOutputOctets)']);
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
$search = @da_sql_query($link,$config,
+ "SELECT sum(AcctSessionTime) FROM $config[sql_accounting_table] WHERE UserName = '$login'
+ AND AcctStartTime >= '$week_start' AND AcctStartTime <= '$now_str';");
+ if ($search){
+ $row = @da_sql_fetch_array($search,$config);
+ $weekly_used = $row['sum(AcctSessionTime)'];
+ }
+ else
+ echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
+ $search = @da_sql_query($link,$config,
"SELECT COUNT(*) FROM $config[sql_accounting_table] WHERE UserName = '$login'
AND AcctStopTime >= '$week_str' AND AcctStopTime <= '$now_str'
AND (AcctTerminateCause LIKE 'Login-Incorrect%' OR