use the same way to display all banners and services contents
[citadel.git] / webcit / setup_wizard.c
index 47e89b8ec849de875fd667e6a6190ee2d5693660..a6beb9a0cbca6fa1ec8a792e06a4a4c8ea4d2034 100644 (file)
@@ -4,56 +4,51 @@
  * First-time setup wizard
  */
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <pthread.h>
-#include <signal.h>
 #include "webcit.h"
 
 
-
 /*
  */
 void do_setup_wizard(void)
 {
+       char *step;
+       FILE *fp;
+
+       step = bstr("step");
 
-       output_headers(1, 1, 2, 0, 1, 0, 0);
+       if (!strcasecmp(step, "Finish")) {
+               fp = fopen(wizard_filename, "w");
+               if (fp != NULL) {
+                       fprintf(fp, "%d\n", serv_info.serv_rev_level);
+                       fclose(fp);
+               }
+               do_welcome();
+               return;
+       }
+
+       output_headers(1, 1, 2, 0, 0, 0);
 
        wprintf("<div id=\"banner\">\n");
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
-       wprintf("<IMG SRC=\"/static/users-icon.gif\" ALT=\" \" ALIGN=MIDDLE>");
-       wprintf("<SPAN CLASS=\"titlebar\">&nbsp;First time setup");
-       wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
-       offer_start_page();
-       wprintf("</TD></TR></TABLE>\n");
-       wprintf("</div>\n"
-               "<div id=\"content\">\n");
-
-       wprintf("<div id=\"fix_scrollbar_bug\">");
-
-       wprintf("wow");
-
-       wprintf("</div>\n"
-               "<div align=center>"
-               "Click on a name to read user info.  Click on "
-               "<IMG ALIGN=MIDDLE SRC=\"/static/page.gif\" ALT=\"(p)\" "
-               "BORDER=0> to send "
-               "a page (instant message) to that user.</div>\n");
+       wprintf("<img src=\"static/citadel-logo.gif\" WIDTH=64 HEIGHT=64");
+       wprintf("<h1>&nbsp;First time setup</h1>");
+       wprintf("</div>\n");
+
+       wprintf("<div id=\"content\" class=\"service\">\n");
+
+       wprintf("<div class=\"fix_scrollbar_bug\">"
+               "<form method=\"post\" action=\"setup_wizard\">\n"
+       );
+       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
+
+       wprintf("<div align=center>"
+               "This is where the setup wizard will be placed.<br>\n"
+               "For now, just click Finish.<br><br>\n"
+       );
+
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Next\">\n");
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Finish\">\n");
+
+       wprintf("</form></div></div>\n");
        wDumpContent(1);
 }