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.

drh 2015-11-17 23:22 trunk
Commit 3967d043e8507f52c614e7cbb0fb373694a805f1
2 files changed +4 -1 +7 -1
+4 -1
--- src/setup.c
+++ src/setup.c
@@ -125,10 +125,12 @@
125125
"A record of received artifacts and their sources");
126126
setup_menu_entry("User Log", "access_log",
127127
"A record of login attempts");
128128
setup_menu_entry("Administrative Log", "admin_log",
129129
"View the admin_log entries");
130
+ setup_menu_entry("Stats", "stat",
131
+ "Repository Status Reports");
130132
setup_menu_entry("Sitemap", "sitemap",
131133
"Links to miscellaneous pages");
132134
setup_menu_entry("SQL", "admin_sql",
133135
"Enter raw SQL commands");
134136
setup_menu_entry("TH1", "admin_th1",
@@ -2062,11 +2064,12 @@
20622064
}
20632065
style_header("Admin Log");
20642066
create_admin_log_table();
20652067
limit = atoi(PD("n","20"));
20662068
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>
20682071
20692072
20702073
@ <div>Limit results to: <span>
20712074
admin_log_render_limits();
20722075
@ </span></div>
20732076
--- 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 @@
427427
int skip = atoi(PD("o","0"));
428428
Blob sql;
429429
Stmt q;
430430
int cnt = 0;
431431
int rc;
432
+ int fLogEnabled;
432433
433434
login_check_credentials();
434435
if( !g.perm.Admin ){ login_needed(0); return; }
435436
create_accesslog_table();
437
+
436438
437439
if( P("delall") && P("delallbtn") ){
438440
db_multi_exec("DELETE FROM accesslog");
439441
cgi_redirectf("%s/access_log?y=%d&n=%d&o=%o", g.zTop, y, n, skip);
440442
return;
@@ -472,11 +474,15 @@
472474
style_submenu_element("Newer", "Newer entries",
473475
"%s/access_log?o=%d&n=%d&y=%d", g.zTop, skip>=n ? skip-n : 0,
474476
n, y);
475477
}
476478
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'>
478484
@ <thead><tr><th width="33%%">Date</th><th width="34%%">User</th>
479485
@ <th width="33%%">IP Address</th></tr></thead><tbody>
480486
while( rc==SQLITE_OK && db_step(&q)==SQLITE_ROW ){
481487
const char *zName = db_column_text(&q, 0);
482488
const char *zIP = db_column_text(&q, 1);
483489
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button