Fossil SCM
Add a button to delete failed login attempts from the access log history.
Commit
ba0852c9df6b3f88f3a06d9a1aaedac7a51e3f9b
Parent
3531091646bd760…
1 file changed
+10
+10
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -414,10 +414,15 @@ | ||
| 414 | 414 | } |
| 415 | 415 | if( P("delanon") && P("delanonbtn") ){ |
| 416 | 416 | db_multi_exec("DELETE FROM accesslog WHERE uname='anonymous'"); |
| 417 | 417 | cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); |
| 418 | 418 | return; |
| 419 | + } | |
| 420 | + if( P("delfail") && P("delfailbtn") ){ | |
| 421 | + db_multi_exec("DELETE FROM accesslog WHERE NOT success"); | |
| 422 | + cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); | |
| 423 | + return; | |
| 419 | 424 | } |
| 420 | 425 | if( P("delold") && P("deloldbtn") ){ |
| 421 | 426 | db_multi_exec("DELETE FROM accesslog WHERE rowid in" |
| 422 | 427 | "(SELECT rowid FROM accesslog ORDER BY rowid DESC" |
| 423 | 428 | " LIMIT -1 OFFSET 200)"); |
| @@ -478,12 +483,17 @@ | ||
| 478 | 483 | @ <form method="post" action="%s(g.zTop)/access_log"> |
| 479 | 484 | @ <input type="checkbox" name="delanon"> |
| 480 | 485 | @ Delete all entries for user "anonymous"</input> |
| 481 | 486 | @ <input type="submit" name="delanonbtn" value="Delete"></input> |
| 482 | 487 | @ </form> |
| 488 | + @ <form method="post" action="%s(g.zTop)/access_log"> | |
| 489 | + @ <input type="checkbox" name="delfail"> | |
| 490 | + @ Delete all failed login attempts</input> | |
| 491 | + @ <input type="submit" name="delfailbtn" value="Delete"></input> | |
| 492 | + @ </form> | |
| 483 | 493 | @ <form method="post" action="%s(g.zTop)/access_log"> |
| 484 | 494 | @ <input type="checkbox" name="delall"> |
| 485 | 495 | @ Delete all entries</input> |
| 486 | 496 | @ <input type="submit" name="delallbtn" value="Delete"></input> |
| 487 | 497 | @ </form> |
| 488 | 498 | style_footer(); |
| 489 | 499 | } |
| 490 | 500 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -414,10 +414,15 @@ | |
| 414 | } |
| 415 | if( P("delanon") && P("delanonbtn") ){ |
| 416 | db_multi_exec("DELETE FROM accesslog WHERE uname='anonymous'"); |
| 417 | cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); |
| 418 | return; |
| 419 | } |
| 420 | if( P("delold") && P("deloldbtn") ){ |
| 421 | db_multi_exec("DELETE FROM accesslog WHERE rowid in" |
| 422 | "(SELECT rowid FROM accesslog ORDER BY rowid DESC" |
| 423 | " LIMIT -1 OFFSET 200)"); |
| @@ -478,12 +483,17 @@ | |
| 478 | @ <form method="post" action="%s(g.zTop)/access_log"> |
| 479 | @ <input type="checkbox" name="delanon"> |
| 480 | @ Delete all entries for user "anonymous"</input> |
| 481 | @ <input type="submit" name="delanonbtn" value="Delete"></input> |
| 482 | @ </form> |
| 483 | @ <form method="post" action="%s(g.zTop)/access_log"> |
| 484 | @ <input type="checkbox" name="delall"> |
| 485 | @ Delete all entries</input> |
| 486 | @ <input type="submit" name="delallbtn" value="Delete"></input> |
| 487 | @ </form> |
| 488 | style_footer(); |
| 489 | } |
| 490 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -414,10 +414,15 @@ | |
| 414 | } |
| 415 | if( P("delanon") && P("delanonbtn") ){ |
| 416 | db_multi_exec("DELETE FROM accesslog WHERE uname='anonymous'"); |
| 417 | cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); |
| 418 | return; |
| 419 | } |
| 420 | if( P("delfail") && P("delfailbtn") ){ |
| 421 | db_multi_exec("DELETE FROM accesslog WHERE NOT success"); |
| 422 | cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); |
| 423 | return; |
| 424 | } |
| 425 | if( P("delold") && P("deloldbtn") ){ |
| 426 | db_multi_exec("DELETE FROM accesslog WHERE rowid in" |
| 427 | "(SELECT rowid FROM accesslog ORDER BY rowid DESC" |
| 428 | " LIMIT -1 OFFSET 200)"); |
| @@ -478,12 +483,17 @@ | |
| 483 | @ <form method="post" action="%s(g.zTop)/access_log"> |
| 484 | @ <input type="checkbox" name="delanon"> |
| 485 | @ Delete all entries for user "anonymous"</input> |
| 486 | @ <input type="submit" name="delanonbtn" value="Delete"></input> |
| 487 | @ </form> |
| 488 | @ <form method="post" action="%s(g.zTop)/access_log"> |
| 489 | @ <input type="checkbox" name="delfail"> |
| 490 | @ Delete all failed login attempts</input> |
| 491 | @ <input type="submit" name="delfailbtn" value="Delete"></input> |
| 492 | @ </form> |
| 493 | @ <form method="post" action="%s(g.zTop)/access_log"> |
| 494 | @ <input type="checkbox" name="delall"> |
| 495 | @ Delete all entries</input> |
| 496 | @ <input type="submit" name="delallbtn" value="Delete"></input> |
| 497 | @ </form> |
| 498 | style_footer(); |
| 499 | } |
| 500 |