Update the badusers page to also use the general_accounting_info_order directive
authorkkalev <kkalev>
Fri, 17 Oct 2003 13:31:45 +0000 (13:31 +0000)
committerkkalev <kkalev>
Fri, 17 Oct 2003 13:31:45 +0000 (13:31 +0000)
dialup_admin/Changelog
dialup_admin/conf/admin.conf
dialup_admin/htdocs/badusers.php3

index efa7bd9..923b032 100644 (file)
@@ -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
index 74a99fa..c636265 100644 (file)
@@ -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
 #
index d9adef8..bcec1d4 100644 (file)
@@ -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 <<<EOM
 <head>
@@ -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 <<<EOM
 <tr><td align="center">
        <form action="badusers.php3" method="get" name="master">
        <table border=0>
-               <tr><td colspan=5></td>
+               <tr><td colspan=6></td>
                        <td rowspan=3 valign="bottom">
                                <small>
                                the <b>from</b> date matches any login after the 00:00 that day,
@@ -134,7 +138,7 @@ echo <<<EOM
                        </td>
                </tr>
                <tr valign="bottom">
-                       <td><small><b>user</td><td><small><b>from date</td><td><small><b>to date</td><td><small><b>pagesize</td><td>
+                       <td><small><b>user</td><td><small><b>from date</td><td><small><b>to date</td><td><small><b>pagesize</td><td><b>order</td>
 &nbsp;</td>
        <tr valign="middle"><td>
 <input type="text" name="login" size="11" value="$login"></td>
@@ -150,6 +154,11 @@ echo <<<EOM
 <option $selected[all] value="all">all
 </select>
 </td>
+<td><select name="order">
+<option $selected[asc] value="asc">older first
+<option $selected[desc] value="desc">recent first
+</select>
+</td>
 EOM;
 ?>