diff --git a/source/include/proto.h b/source/include/proto.h index b7c64cbc251..54f833a93e8 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -1929,6 +1929,7 @@ char *cgi_rooturl(void); char *cgi_pathinfo(void); char *cgi_remote_host(void); char *cgi_remote_addr(void); +BOOL cgi_waspost(void); /*The following definitions come from web/diagnose.c */ diff --git a/source/web/cgi.c b/source/web/cgi.c index c5b2ac55f15..065c524cb86 100644 --- a/source/web/cgi.c +++ b/source/web/cgi.c @@ -26,7 +26,7 @@ /* set the expiry on fixed pages */ #define EXPIRY_TIME (60*60*24*7) -#define CGI_LOGGING 0 +#define CGI_LOGGING 1 #ifdef DEBUG_COMMENTS extern void print_title(char *fmt, ...); @@ -688,3 +688,15 @@ char *cgi_remote_addr(void) } return getenv("REMOTE_ADDR"); } + + +/*************************************************************************** +return True if the request was a POST + ***************************************************************************/ +BOOL cgi_waspost(void) +{ + if (baseurl) { + return request_post; + } + return strequal(getenv("REQUEST_METHOD"), "POST"); +} diff --git a/source/web/statuspage.c b/source/web/statuspage.c index 41681c22283..98c0982b99d 100644 --- a/source/web/statuspage.c +++ b/source/web/statuspage.c @@ -107,11 +107,6 @@ void status_page(void) refresh_interval = atoi(v); } - if (autorefresh) { - printf("\n", - refresh_interval, cgi_baseurl(), refresh_interval); - } - pstrcpy(fname,lp_lockdir()); standard_sub_basic(fname); trim_string(fname,"","/"); @@ -147,6 +142,15 @@ void status_page(void) printf("\n"); printf("
Refresh Interval: %d\n", refresh_interval); printf("\n"); + /* this little JavaScript allows for automatic refresh + of the page. There are other methods but this seems + to be the best alternative */ + printf("\n"); } printf("

\n");