From: Andrew Tridgell Date: Wed, 2 Sep 1998 02:02:30 +0000 (+0000) Subject: use /swat/ prefix in both inetd and cgi modes, to enable a static header.html X-Git-Tag: samba-2.0.0alpha3~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddb788c24d043b18506138a7759b8128df1673aa;p=thirdparty%2Fsamba.git use /swat/ prefix in both inetd and cgi modes, to enable a static header.html --- diff --git a/source/web/cgi.c b/source/web/cgi.c index 9804f93adf9..97dac86668c 100644 --- a/source/web/cgi.c +++ b/source/web/cgi.c @@ -622,8 +622,10 @@ void cgi_setup(char *rootdir, int auth_required) *p = 0; } - if (strstr(url+1,"..")==0 && file_exist(url+1, NULL)) { - cgi_download(url+1); + string_sub(url, "/swat/", ""); + + if (strstr(url,"..")==0 && file_exist(url, NULL)) { + cgi_download(url); } printf("HTTP/1.1 200 OK\r\nConnection: close\r\n"); @@ -644,18 +646,6 @@ char *cgi_baseurl(void) return getenv("SCRIPT_NAME"); } -/*************************************************************************** -return the root URL for images etc - ***************************************************************************/ -char *cgi_rooturl(void) -{ - if (baseurl) { - return "/"; - } - return "/swat/"; -} - - /*************************************************************************** return the current pages path info ***************************************************************************/ diff --git a/source/web/swat.c b/source/web/swat.c index 504552ec402..2665df5d1b2 100644 --- a/source/web/swat.c +++ b/source/web/swat.c @@ -107,7 +107,7 @@ static void print_header(void) if (!include_html("include/header.html")) { printf("\n"); - printf("\n\nSamba Web Administration Tool\n\n\n\n", cgi_rooturl()); + printf("\n\nSamba Web Administration Tool\n\n\n\n"); } } @@ -132,8 +132,8 @@ static void show_parameter(int snum, struct parm_struct *parm) ptr = lp_local_ptr(snum, ptr); } - printf("? %s", - cgi_rooturl(), parm->label, parm->label); + printf("? %s", + parm->label, parm->label); switch (parm->type) { case P_CHAR: @@ -355,10 +355,9 @@ static void load_config(void) /* spit out the html for a link with an image */ static void image_link(char *name,char *hlink, char *src, int width, int height) { - printf("\"%s\"\n", + printf("\"%s\"\n", cgi_baseurl(), hlink, width, height, - cgi_rooturl(), src, name); }