]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
* Use Max-Monthly-Session not Max-Weekly-Session for the monthly limit
authorkkalev <kkalev>
Mon, 5 May 2003 23:10:04 +0000 (23:10 +0000)
committerkkalev <kkalev>
Mon, 5 May 2003 23:10:04 +0000 (23:10 +0000)
* When checking the weekly limit check first that $remaining is numeric before doing any comparisons

Changelog
htdocs/user_admin.php3

index 44a4eafa44224bf02aee3f1d5eea515de0e95796..59a81c4f9782b60d0f36f5ab021612968fc17aba 100644 (file)
--- 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
index 4dac15a812b01a8d0f6842aa8f6c13784dd59cc0..987f54bf248dcea88f99fb90a3072f230fa7cae4 100644 (file)
@@ -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';