Fossil SCM

Backoffice only runs for successful webpage that have the database open. Add "refresh" and "Show All" buttons on the /errorlog page.

drh 2018-07-19 15:52 trunk
Commit aa17077eafbbad371ee0a1a6fcdd7cc78e16bd74d9bd898d254921a171cef2a2
2 files changed +3 -1 +6 -2
+3 -1
--- src/cgi.c
+++ src/cgi.c
@@ -343,11 +343,13 @@
343343
CGIDEBUG(("DONE\n"));
344344
345345
/* After the webpage has been sent, do any useful background
346346
** processing.
347347
*/
348
- backoffice_run();
348
+ if( g.db!=0 && iReplyStatus==200 ){
349
+ backoffice_run();
350
+ }
349351
}
350352
351353
/*
352354
** Do a redirect request to the URL given in the argument.
353355
**
354356
--- src/cgi.c
+++ src/cgi.c
@@ -343,11 +343,13 @@
343 CGIDEBUG(("DONE\n"));
344
345 /* After the webpage has been sent, do any useful background
346 ** processing.
347 */
348 backoffice_run();
 
 
349 }
350
351 /*
352 ** Do a redirect request to the URL given in the argument.
353 **
354
--- src/cgi.c
+++ src/cgi.c
@@ -343,11 +343,13 @@
343 CGIDEBUG(("DONE\n"));
344
345 /* After the webpage has been sent, do any useful background
346 ** processing.
347 */
348 if( g.db!=0 && iReplyStatus==200 ){
349 backoffice_run();
350 }
351 }
352
353 /*
354 ** Do a redirect request to the URL given in the argument.
355 **
356
--- src/security_audit.c
+++ src/security_audit.c
@@ -415,10 +415,11 @@
415415
login_needed(0);
416416
return;
417417
}
418418
style_header("Server Error Log");
419419
style_submenu_element("Test", "%R/test-warning");
420
+ style_submenu_element("Refresh", "%R/errorlog");
420421
if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
421422
@ <p>To create a server error log:
422423
@ <ol>
423424
@ <li><p>
424425
@ If the server is running as CGI, then create a line in the CGI file
@@ -462,12 +463,15 @@
462463
if( in==0 ){
463464
@ <p class='generalError'>Unable top open that file for reading!</p>
464465
style_footer();
465466
return;
466467
}
467
- if( szFile>MXSHOWLOG ){
468
- @ Only the last %,d(MXSHOWLOG) bytes are shown.
468
+ if( szFile>MXSHOWLOG && P("all")==0 ){
469
+ @ <form action="%R/errorlog" method="POST">
470
+ @ <p>Only the last %,d(MXSHOWLOG) bytes are shown.
471
+ @ <input type="submit" name="all" value="Show All">
472
+ @ </form>
469473
fseek(in, -MXSHOWLOG, SEEK_END);
470474
}
471475
@ <hr>
472476
@ <pre>
473477
while( fgets(z, sizeof(z), in) ){
474478
--- src/security_audit.c
+++ src/security_audit.c
@@ -415,10 +415,11 @@
415 login_needed(0);
416 return;
417 }
418 style_header("Server Error Log");
419 style_submenu_element("Test", "%R/test-warning");
 
420 if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
421 @ <p>To create a server error log:
422 @ <ol>
423 @ <li><p>
424 @ If the server is running as CGI, then create a line in the CGI file
@@ -462,12 +463,15 @@
462 if( in==0 ){
463 @ <p class='generalError'>Unable top open that file for reading!</p>
464 style_footer();
465 return;
466 }
467 if( szFile>MXSHOWLOG ){
468 @ Only the last %,d(MXSHOWLOG) bytes are shown.
 
 
 
469 fseek(in, -MXSHOWLOG, SEEK_END);
470 }
471 @ <hr>
472 @ <pre>
473 while( fgets(z, sizeof(z), in) ){
474
--- src/security_audit.c
+++ src/security_audit.c
@@ -415,10 +415,11 @@
415 login_needed(0);
416 return;
417 }
418 style_header("Server Error Log");
419 style_submenu_element("Test", "%R/test-warning");
420 style_submenu_element("Refresh", "%R/errorlog");
421 if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
422 @ <p>To create a server error log:
423 @ <ol>
424 @ <li><p>
425 @ If the server is running as CGI, then create a line in the CGI file
@@ -462,12 +463,15 @@
463 if( in==0 ){
464 @ <p class='generalError'>Unable top open that file for reading!</p>
465 style_footer();
466 return;
467 }
468 if( szFile>MXSHOWLOG && P("all")==0 ){
469 @ <form action="%R/errorlog" method="POST">
470 @ <p>Only the last %,d(MXSHOWLOG) bytes are shown.
471 @ <input type="submit" name="all" value="Show All">
472 @ </form>
473 fseek(in, -MXSHOWLOG, SEEK_END);
474 }
475 @ <hr>
476 @ <pre>
477 while( fgets(z, sizeof(z), in) ){
478

Keyboard Shortcuts

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