Getting ready for first Red Hat Linux RPMs for 1.9.19 pre-alpha release
[samba.git] / source / web / cgi.c
index 9931ca1468897dd69ae04fbaa0c665893d427e5d..a1aa4d753dc96e79b0a36ada7d6dba54d167dbf6 100644 (file)
@@ -561,7 +561,9 @@ void cgi_setup(char *rootdir, int auth_required)
 
 #if CGI_LOGGING
        f = fopen("/tmp/cgi.log", "a");
-       if (f) fprintf(f,"\n[Date: %s]\n", http_timestring(time(NULL)));
+       if (f) fprintf(f,"\n[Date: %s   %s (%s)]\n", 
+                      http_timestring(time(NULL)),
+                      client_name(1), client_addr(1));
 #endif
 
        /* we are a mini-web server. We need to read the request from stdin
@@ -686,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");
+}