From 7b07680d3b1a302de8284df10658546b75da9887 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 1 Sep 1998 06:03:03 +0000 Subject: spruced up SWAT a bit - it now uses the new Samba logo at the top and a table to give it a little border (This used to be commit d35c6e80988d96049d4624b47ae9ea015edafc59) --- source3/web/swat.c | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'source3') diff --git a/source3/web/swat.c b/source3/web/swat.c index 3a56c82229..504552ec40 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -74,26 +74,9 @@ char *p = parmname; return parmname; } -/* start the page with standard stuff */ -static void print_header(void) -{ - if (!cgi_waspost()) { - printf("Expires: 0\r\n"); - } - printf("Content-type: text/html\r\n\r\n"); - printf("\n"); - printf("\n\nSamba Web Administration Tool\n\n\n\n", cgi_rooturl()); -} - - -/* finish off the page */ -static void print_footer(void) -{ - printf("\n\n\n"); -} /* include a lump of html in a page */ -static void include_html(char *fname) +static int include_html(char *fname) { FILE *f = fopen(fname,"r"); char buf[1024]; @@ -101,7 +84,7 @@ static void include_html(char *fname) if (!f) { printf("ERROR: Can't open %s\n", fname); - return; + return 0; } while (!feof(f)) { @@ -111,9 +94,34 @@ static void include_html(char *fname) } fclose(f); + return 1; +} + +/* start the page with standard stuff */ +static void print_header(void) +{ + if (!cgi_waspost()) { + printf("Expires: 0\r\n"); + } + printf("Content-type: text/html\r\n\r\n"); + + if (!include_html("include/header.html")) { + printf("\n"); + printf("\n\nSamba Web Administration Tool\n\n\n\n", cgi_rooturl()); + } } +/* finish off the page */ +static void print_footer(void) +{ + if (!include_html("include/footer.html")) { + printf("\n\n\n"); + } +} + + + /* display one editable parameter in a form */ static void show_parameter(int snum, struct parm_struct *parm) { @@ -358,8 +366,6 @@ static void image_link(char *name,char *hlink, char *src, int width, int height) with a title */ static void show_main_buttons(void) { - printf("

Samba Web Administration Tool

\n"); - image_link("Home", "", "images/home.gif", 50, 50); image_link("Globals", "globals", "images/globals.gif", 50, 50); image_link("Shares", "shares", "images/shares.gif", 50, 50); -- cgit