From 18ece039c305f018e4ff800ba6410946ebb6babe Mon Sep 17 00:00:00 2001 From: kkalev Date: Mon, 5 May 2003 23:10:04 +0000 Subject: [PATCH] * 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 --- Changelog | 2 ++ htdocs/user_admin.php3 | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 44a4eaf..59a81c4 100644 --- a/Changelog +++ b/Changelog @@ -21,6 +21,8 @@ Ver 1.63: * Add support for regexp and like operators in accounting report generator * Limit the split() to 2 elements in lib/defaults.php3 * 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 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 diff --git a/htdocs/user_admin.php3 b/htdocs/user_admin.php3 index 4dac15a..987f54b 100644 --- a/htdocs/user_admin.php3 +++ b/htdocs/user_admin.php3 @@ -47,7 +47,7 @@ EOM; exit(); } -$monthly_limit = ($item_vals['Max-Weekly-Session'][0] != '') ? $item_vals['Max-Weekly-Session'][0] : $default_vals['Max-Weekly-Session'][0]; +$monthly_limit = ($item_vals['Max-Monthly-Session'][0] != '') ? $item_vals['Max-Monthly-Session'][0] : $default_vals['Max-Monthly-Session'][0]; $monthly_limit = ($monthly_limit) ? $monthly_limit : $config[counter_default_monthly]; $weekly_limit = ($item_vals['Max-Weekly-Session'][0] != '') ? $item_vals['Max-Weekly-Session'][0] : $default_vals['Max-Weekly-Session'][0]; $weekly_limit = ($weekly_limit) ? $weekly_limit : $config[counter_default_weekly]; @@ -154,6 +154,8 @@ if ($link){ $tmp = 0; $extra_msg .= '(Out of weekly quota)'; } + if (!is_numeric($remaining)) + $remaining = $tmp; if ($remaining > $tmp) $remaining = $tmp; $log_color = ($remaining) ? 'green' : 'red'; -- 2.39.5