Fossil SCM
Backoffice only runs for successful webpage that have the database open. Add "refresh" and "Show All" buttons on the /errorlog page.
Commit
aa17077eafbbad371ee0a1a6fcdd7cc78e16bd74d9bd898d254921a171cef2a2
Parent
0fdca8c78f3ca87…
2 files changed
+3
-1
+6
-2
+3
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -343,11 +343,13 @@ | ||
| 343 | 343 | CGIDEBUG(("DONE\n")); |
| 344 | 344 | |
| 345 | 345 | /* After the webpage has been sent, do any useful background |
| 346 | 346 | ** processing. |
| 347 | 347 | */ |
| 348 | - backoffice_run(); | |
| 348 | + if( g.db!=0 && iReplyStatus==200 ){ | |
| 349 | + backoffice_run(); | |
| 350 | + } | |
| 349 | 351 | } |
| 350 | 352 | |
| 351 | 353 | /* |
| 352 | 354 | ** Do a redirect request to the URL given in the argument. |
| 353 | 355 | ** |
| 354 | 356 |
| --- 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 |
+6
-2
| --- src/security_audit.c | ||
| +++ src/security_audit.c | ||
| @@ -415,10 +415,11 @@ | ||
| 415 | 415 | login_needed(0); |
| 416 | 416 | return; |
| 417 | 417 | } |
| 418 | 418 | style_header("Server Error Log"); |
| 419 | 419 | style_submenu_element("Test", "%R/test-warning"); |
| 420 | + style_submenu_element("Refresh", "%R/errorlog"); | |
| 420 | 421 | if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){ |
| 421 | 422 | @ <p>To create a server error log: |
| 422 | 423 | @ <ol> |
| 423 | 424 | @ <li><p> |
| 424 | 425 | @ If the server is running as CGI, then create a line in the CGI file |
| @@ -462,12 +463,15 @@ | ||
| 462 | 463 | if( in==0 ){ |
| 463 | 464 | @ <p class='generalError'>Unable top open that file for reading!</p> |
| 464 | 465 | style_footer(); |
| 465 | 466 | return; |
| 466 | 467 | } |
| 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> | |
| 469 | 473 | fseek(in, -MXSHOWLOG, SEEK_END); |
| 470 | 474 | } |
| 471 | 475 | @ <hr> |
| 472 | 476 | @ <pre> |
| 473 | 477 | while( fgets(z, sizeof(z), in) ){ |
| 474 | 478 |
| --- 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 |