spruced up SWAT a bit - it now uses the new Samba logo at the top and
authorAndrew Tridgell <tridge@samba.org>
Tue, 1 Sep 1998 06:03:03 +0000 (06:03 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 1 Sep 1998 06:03:03 +0000 (06:03 +0000)
a table to give it a little border
(This used to be commit d35c6e80988d96049d4624b47ae9ea015edafc59)

source3/web/swat.c
swat/images/samba.gif [new file with mode: 0644]
swat/include/footer.html [new file with mode: 0644]
swat/include/header.html [new file with mode: 0644]

index 3a56c82229821bf0d1171241f8879cd1f37b3237..504552ec402b13821aef56c0ec6902a0ee5bf395 100644 (file)
@@ -74,26 +74,9 @@ char *p = parmname;
        return 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("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n");
-       printf("<HTML>\n<HEAD>\n<TITLE>Samba Web Administration Tool</TITLE>\n</HEAD>\n<BODY background=\"%simages/background.jpg\">\n\n", cgi_rooturl());
-}
-
-
-/* finish off the page */
-static void print_footer(void)
-{
-       printf("\n</BODY>\n</HTML>\n");
-}
 
 /* include a lump of html in a page */
 
 /* 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];
 {
        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);
 
        if (!f) {
                printf("ERROR: Can't open %s\n", fname);
-               return;
+               return 0;
        }
 
        while (!feof(f)) {
        }
 
        while (!feof(f)) {
@@ -111,9 +94,34 @@ static void include_html(char *fname)
        }
 
        fclose(f);
        }
 
        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("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n");
+               printf("<HTML>\n<HEAD>\n<TITLE>Samba Web Administration Tool</TITLE>\n</HEAD>\n<BODY background=\"%simages/background.jpg\">\n\n", cgi_rooturl());
+       }
 }
 
 
 }
 
 
+/* finish off the page */
+static void print_footer(void)
+{
+       if (!include_html("include/footer.html")) {
+               printf("\n</BODY>\n</HTML>\n");
+       }
+}
+
+
+
 /* display one editable parameter in a form */
 static void show_parameter(int snum, struct parm_struct *parm)
 {
 /* 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)
 {
    with a title */
 static void show_main_buttons(void)
 {
-       printf("<H2 align=center>Samba Web Administration Tool</H2>\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);
        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);
diff --git a/swat/images/samba.gif b/swat/images/samba.gif
new file mode 100644 (file)
index 0000000..3ec3d21
Binary files /dev/null and b/swat/images/samba.gif differ
diff --git a/swat/include/footer.html b/swat/include/footer.html
new file mode 100644 (file)
index 0000000..7c3b483
--- /dev/null
@@ -0,0 +1,3 @@
+</TD></TR></TABLE></CENTER>
+</BODY>
+</HTML>
diff --git a/swat/include/header.html b/swat/include/header.html
new file mode 100644 (file)
index 0000000..b4f7552
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<TITLE>Samba Web Administration Tool</TITLE>
+</HEAD>
+<BODY bgcolor="white">
+<CENTER>
+<IMG SRC="images/samba.gif" ALT="[ Samba ]" border=0><BR>
+<TABLE WIDTH="98%" CELLSPACING=1 CELLPADDING=4 BORDER=1>
+<TR><TD BGCOLOR="#ddddd0">