Show number of failed logins in the last 7 days in the user admin page
authorkkalev <kkalev>
Wed, 28 Aug 2002 12:26:58 +0000 (12:26 +0000)
committerkkalev <kkalev>
Wed, 28 Aug 2002 12:26:58 +0000 (12:26 +0000)
dialup_admin/Changelog
dialup_admin/htdocs/user_admin.php3
dialup_admin/html/user_admin.html.php3

index 4e6599e..d03cb44 100644 (file)
@@ -1,5 +1,6 @@
 Ver 1.56:
 * Small html fixes in user_edit.php3 and password.php3
+* Show number of failed logins in the last 7 days in the user admin page
 Ver 1.55:
 * Update the FAQ about missing attributes from the user/group edit pages and add a few comments
   in the configuration files
index 3420623..d962c48 100644 (file)
@@ -98,6 +98,16 @@ if ($link){
                $avg_output = bytes2str($row['avg(AcctOutputOctets)']);
                $tot_conns = $row['COUNT(*)'];
        }
+       $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
+       AcctTerminateCause LIKE 'Invalid-User%' OR
+       AcctTerminateCause LIKE 'Multiple-Logins%';");
+       if ($search){
+               $row = @da_sql_fetch_array($search,$config);
+               $tot_badlogins = $row['COUNT(*)'];
+       }
        for($i = 0; $i <=6; $i++){
                if ($days[$i] == '')
                        continue;
index 015784c..ea1c43e 100644 (file)
@@ -240,6 +240,8 @@ lign=top>
        <b><font color="darkblue">$tot_conns</font></b></td></tr>
        <tr><td align=center bgcolor="#d0ddb0">Online time</td><td>
        <b><font color="darkblue">$tot_time</td></tr></td></tr>
+       <tr><td align=center bgcolor="#d0ddb0">Failed Logins</td><td>
+       <b><font color="darkblue">$tot_badlogins</td></tr></td></tr>
        <tr><td align=center bgcolor="#d0ddb0">Upload</td><td>
        $tot_input</td></tr></td></tr>
        <tr><td align=center bgcolor="#d0ddb0">Download</td><td>