From 4cb5921a13371000230ba4012e2937e1ee17073d Mon Sep 17 00:00:00 2001 From: kkalev Date: Fri, 17 Oct 2003 13:31:45 +0000 Subject: [PATCH] Update the badusers page to also use the general_accounting_info_order directive --- Changelog | 1 + conf/admin.conf | 2 +- htdocs/badusers.php3 | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index efa7bd9..923b032 100644 --- a/Changelog +++ b/Changelog @@ -54,6 +54,7 @@ Ver 1.63: * Fix a small bug in bytes2str. It will now also show GBs if appropriate * Add an entry about the failed_logins page * Update the help page for the lock message attribute +* Update the badusers page to also use the general_accounting_info_order directive 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/conf/admin.conf b/conf/admin.conf index 74a99fa..c636265 100644 --- a/conf/admin.conf +++ b/conf/admin.conf @@ -114,7 +114,7 @@ general_auth_request_file: %{general_base_dir}/conf/auth.request general_encryption_method: crypt # # can be either asc (older dates first) or desc (recent dates first) -# This is used in the user accounting page +# This is used in the user accounting and badusers pages # general_accounting_info_order: desc # diff --git a/htdocs/badusers.php3 b/htdocs/badusers.php3 index d9adef8..bcec1d4 100644 --- a/htdocs/badusers.php3 +++ b/htdocs/badusers.php3 @@ -31,6 +31,10 @@ $limit = ($pagesize == 'all') ? '' : "LIMIT $pagesize"; $selected[$pagesize] = 'selected'; $login = ($login != '') ? $login : 'anyone'; $usercheck = ($login == 'anyone') ? "LIKE '%'" : "= '$login'"; +$order = ($order != '') ? $order : $config[general_accounting_info_order]; +if ($order != 'desc' && $order != 'asc') + $order = 'desc'; +$selected[$order] = 'selected'; echo << @@ -90,7 +94,7 @@ if ($link){ $search = @da_sql_query($link,$config, "SELECT * FROM $config[sql_badusers_table] WHERE UserName $usercheck AND Date <= '$now_str' - AND Date >= '$prev_str' ORDER BY Date ASC $limit;"); + AND Date >= '$prev_str' ORDER BY Date $order $limit;"); if ($search){ while( $row = @da_sql_fetch_array($search,$config) ){ $num++; @@ -125,7 +129,7 @@ echo <<
- + -   @@ -150,6 +154,11 @@ echo <<all + EOM; ?> -- 2.39.5
the from date matches any login after the 00:00 that day, @@ -134,7 +138,7 @@ echo <<
userfrom dateto datepagesize + userfrom dateto datepagesizeorder
+