Fossil SCM
Show how to enable/disable the access-log and admin-log from their display pages. Add the "Stats" button to the Admin main menu.
Commit
3967d043e8507f52c614e7cbb0fb373694a805f1
Parent
e60a021167ceb53…
2 files changed
+4
-1
+7
-1
+4
-1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -125,10 +125,12 @@ | ||
| 125 | 125 | "A record of received artifacts and their sources"); |
| 126 | 126 | setup_menu_entry("User Log", "access_log", |
| 127 | 127 | "A record of login attempts"); |
| 128 | 128 | setup_menu_entry("Administrative Log", "admin_log", |
| 129 | 129 | "View the admin_log entries"); |
| 130 | + setup_menu_entry("Stats", "stat", | |
| 131 | + "Repository Status Reports"); | |
| 130 | 132 | setup_menu_entry("Sitemap", "sitemap", |
| 131 | 133 | "Links to miscellaneous pages"); |
| 132 | 134 | setup_menu_entry("SQL", "admin_sql", |
| 133 | 135 | "Enter raw SQL commands"); |
| 134 | 136 | setup_menu_entry("TH1", "admin_th1", |
| @@ -2062,11 +2064,12 @@ | ||
| 2062 | 2064 | } |
| 2063 | 2065 | style_header("Admin Log"); |
| 2064 | 2066 | create_admin_log_table(); |
| 2065 | 2067 | limit = atoi(PD("n","20")); |
| 2066 | 2068 | fLogEnabled = db_get_boolean("admin-log", 0); |
| 2067 | - @ <div>Admin logging is %s(fLogEnabled?"on":"off").</div> | |
| 2069 | + @ <div>Admin logging is %s(fLogEnabled?"on":"off"). | |
| 2070 | + @ (Change this on the <a href="setup_settings">settings</a> page.)</div> | |
| 2068 | 2071 | |
| 2069 | 2072 | |
| 2070 | 2073 | @ <div>Limit results to: <span> |
| 2071 | 2074 | admin_log_render_limits(); |
| 2072 | 2075 | @ </span></div> |
| 2073 | 2076 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -125,10 +125,12 @@ | |
| 125 | "A record of received artifacts and their sources"); |
| 126 | setup_menu_entry("User Log", "access_log", |
| 127 | "A record of login attempts"); |
| 128 | setup_menu_entry("Administrative Log", "admin_log", |
| 129 | "View the admin_log entries"); |
| 130 | setup_menu_entry("Sitemap", "sitemap", |
| 131 | "Links to miscellaneous pages"); |
| 132 | setup_menu_entry("SQL", "admin_sql", |
| 133 | "Enter raw SQL commands"); |
| 134 | setup_menu_entry("TH1", "admin_th1", |
| @@ -2062,11 +2064,12 @@ | |
| 2062 | } |
| 2063 | style_header("Admin Log"); |
| 2064 | create_admin_log_table(); |
| 2065 | limit = atoi(PD("n","20")); |
| 2066 | fLogEnabled = db_get_boolean("admin-log", 0); |
| 2067 | @ <div>Admin logging is %s(fLogEnabled?"on":"off").</div> |
| 2068 | |
| 2069 | |
| 2070 | @ <div>Limit results to: <span> |
| 2071 | admin_log_render_limits(); |
| 2072 | @ </span></div> |
| 2073 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -125,10 +125,12 @@ | |
| 125 | "A record of received artifacts and their sources"); |
| 126 | setup_menu_entry("User Log", "access_log", |
| 127 | "A record of login attempts"); |
| 128 | setup_menu_entry("Administrative Log", "admin_log", |
| 129 | "View the admin_log entries"); |
| 130 | setup_menu_entry("Stats", "stat", |
| 131 | "Repository Status Reports"); |
| 132 | setup_menu_entry("Sitemap", "sitemap", |
| 133 | "Links to miscellaneous pages"); |
| 134 | setup_menu_entry("SQL", "admin_sql", |
| 135 | "Enter raw SQL commands"); |
| 136 | setup_menu_entry("TH1", "admin_th1", |
| @@ -2062,11 +2064,12 @@ | |
| 2064 | } |
| 2065 | style_header("Admin Log"); |
| 2066 | create_admin_log_table(); |
| 2067 | limit = atoi(PD("n","20")); |
| 2068 | fLogEnabled = db_get_boolean("admin-log", 0); |
| 2069 | @ <div>Admin logging is %s(fLogEnabled?"on":"off"). |
| 2070 | @ (Change this on the <a href="setup_settings">settings</a> page.)</div> |
| 2071 | |
| 2072 | |
| 2073 | @ <div>Limit results to: <span> |
| 2074 | admin_log_render_limits(); |
| 2075 | @ </span></div> |
| 2076 |
+7
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -427,14 +427,16 @@ | ||
| 427 | 427 | int skip = atoi(PD("o","0")); |
| 428 | 428 | Blob sql; |
| 429 | 429 | Stmt q; |
| 430 | 430 | int cnt = 0; |
| 431 | 431 | int rc; |
| 432 | + int fLogEnabled; | |
| 432 | 433 | |
| 433 | 434 | login_check_credentials(); |
| 434 | 435 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 435 | 436 | create_accesslog_table(); |
| 437 | + | |
| 436 | 438 | |
| 437 | 439 | if( P("delall") && P("delallbtn") ){ |
| 438 | 440 | db_multi_exec("DELETE FROM accesslog"); |
| 439 | 441 | cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); |
| 440 | 442 | return; |
| @@ -472,11 +474,15 @@ | ||
| 472 | 474 | style_submenu_element("Newer", "Newer entries", |
| 473 | 475 | "%s/access_log?o=%d&n=%d&y=%d", g.zTop, skip>=n ? skip-n : 0, |
| 474 | 476 | n, y); |
| 475 | 477 | } |
| 476 | 478 | rc = db_prepare_ignore_error(&q, "%s", blob_sql_text(&sql)); |
| 477 | - @ <center><table border="1" cellpadding="5" id='logtable'> | |
| 479 | + @ <center> | |
| 480 | + fLogEnabled = db_get_boolean("access-log", 0); | |
| 481 | + @ <div>Access logging is %s(fLogEnabled?"on":"off"). | |
| 482 | + @ (Change this on the <a href="setup_settings">settings</a> page.)</div> | |
| 483 | + @ <table border="1" cellpadding="5" id='logtable'> | |
| 478 | 484 | @ <thead><tr><th width="33%%">Date</th><th width="34%%">User</th> |
| 479 | 485 | @ <th width="33%%">IP Address</th></tr></thead><tbody> |
| 480 | 486 | while( rc==SQLITE_OK && db_step(&q)==SQLITE_ROW ){ |
| 481 | 487 | const char *zName = db_column_text(&q, 0); |
| 482 | 488 | const char *zIP = db_column_text(&q, 1); |
| 483 | 489 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -427,14 +427,16 @@ | |
| 427 | int skip = atoi(PD("o","0")); |
| 428 | Blob sql; |
| 429 | Stmt q; |
| 430 | int cnt = 0; |
| 431 | int rc; |
| 432 | |
| 433 | login_check_credentials(); |
| 434 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 435 | create_accesslog_table(); |
| 436 | |
| 437 | if( P("delall") && P("delallbtn") ){ |
| 438 | db_multi_exec("DELETE FROM accesslog"); |
| 439 | cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); |
| 440 | return; |
| @@ -472,11 +474,15 @@ | |
| 472 | style_submenu_element("Newer", "Newer entries", |
| 473 | "%s/access_log?o=%d&n=%d&y=%d", g.zTop, skip>=n ? skip-n : 0, |
| 474 | n, y); |
| 475 | } |
| 476 | rc = db_prepare_ignore_error(&q, "%s", blob_sql_text(&sql)); |
| 477 | @ <center><table border="1" cellpadding="5" id='logtable'> |
| 478 | @ <thead><tr><th width="33%%">Date</th><th width="34%%">User</th> |
| 479 | @ <th width="33%%">IP Address</th></tr></thead><tbody> |
| 480 | while( rc==SQLITE_OK && db_step(&q)==SQLITE_ROW ){ |
| 481 | const char *zName = db_column_text(&q, 0); |
| 482 | const char *zIP = db_column_text(&q, 1); |
| 483 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -427,14 +427,16 @@ | |
| 427 | int skip = atoi(PD("o","0")); |
| 428 | Blob sql; |
| 429 | Stmt q; |
| 430 | int cnt = 0; |
| 431 | int rc; |
| 432 | int fLogEnabled; |
| 433 | |
| 434 | login_check_credentials(); |
| 435 | if( !g.perm.Admin ){ login_needed(0); return; } |
| 436 | create_accesslog_table(); |
| 437 | |
| 438 | |
| 439 | if( P("delall") && P("delallbtn") ){ |
| 440 | db_multi_exec("DELETE FROM accesslog"); |
| 441 | cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip); |
| 442 | return; |
| @@ -472,11 +474,15 @@ | |
| 474 | style_submenu_element("Newer", "Newer entries", |
| 475 | "%s/access_log?o=%d&n=%d&y=%d", g.zTop, skip>=n ? skip-n : 0, |
| 476 | n, y); |
| 477 | } |
| 478 | rc = db_prepare_ignore_error(&q, "%s", blob_sql_text(&sql)); |
| 479 | @ <center> |
| 480 | fLogEnabled = db_get_boolean("access-log", 0); |
| 481 | @ <div>Access logging is %s(fLogEnabled?"on":"off"). |
| 482 | @ (Change this on the <a href="setup_settings">settings</a> page.)</div> |
| 483 | @ <table border="1" cellpadding="5" id='logtable'> |
| 484 | @ <thead><tr><th width="33%%">Date</th><th width="34%%">User</th> |
| 485 | @ <th width="33%%">IP Address</th></tr></thead><tbody> |
| 486 | while( rc==SQLITE_OK && db_step(&q)==SQLITE_ROW ){ |
| 487 | const char *zName = db_column_text(&q, 0); |
| 488 | const char *zIP = db_column_text(&q, 1); |
| 489 |