* Created the framework for the "first time setup wizard"
authorArt Cancro <ajc@citadel.org>
Thu, 10 Mar 2005 05:13:21 +0000 (05:13 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 10 Mar 2005 05:13:21 +0000 (05:13 +0000)
webcit/ChangeLog
webcit/auth.c
webcit/setup_wizard.c

index 37bf3fed7a15be38d36f9546ed348d7476ab93b1..d8c6d4e395f68607dece1256f25d83a16614bbb2 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 603.12  2005/03/10 05:13:21  ajc
+* Created the framework for the "first time setup wizard"
+
 Revision 603.11  2005/03/09 04:08:30  ajc
 * Delete room is now confirmed through a JavaScript popup instead of
   a transition page
@@ -2481,3 +2484,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index b7d6b64a27de109be3f0479a57012f28b06ea5a2..78f15f23924a72c445da8cef7dc76b8a956ff049 100644 (file)
@@ -46,7 +46,6 @@ void display_login(char *mesg)
        char buf[SIZ];
 
        output_headers(1, 1, 2, 0, 0, 0, 0);
-       //wprintf("<div id=\"content\">\n");
        wprintf("<div style=\"position:absolute; top:20px; left:20px; right:20px\">\n");
 
        if (mesg != NULL) if (strlen(mesg) > 0) {
@@ -161,29 +160,32 @@ void do_welcome(void)
        /*
         * See if we have to run the first-time setup wizard
         */
-       if (!setup_wizard) {
-               sprintf(wizard_filename, "setupwiz.%s.%s", ctdlhost, ctdlport);
-               for (i=0; i<strlen(wizard_filename); ++i) {
-                       if (    (wizard_filename[i]==' ')
-                               || (wizard_filename[i] == '/')
-                       ) {
-                               wizard_filename[i] = '_';
+       if (WC->is_aide) {
+               if (!setup_wizard) {
+                       sprintf(wizard_filename, "setupwiz.%s.%s",
+                               ctdlhost, ctdlport);
+                       for (i=0; i<strlen(wizard_filename); ++i) {
+                               if (    (wizard_filename[i]==' ')
+                                       || (wizard_filename[i] == '/')
+                               ) {
+                                       wizard_filename[i] = '_';
+                               }
                        }
-               }
-
-               fp = fopen(wizard_filename, "r");
-               if (fp != NULL) {
-                       fgets(buf, sizeof buf, fp);
-                       buf[strlen(buf)-1] = 0;
-                       fclose(fp);
-                       if (atoi(buf) != serv_info.serv_rev_level) {
-                               setup_wizard = 1;       /* already run */
+       
+                       fp = fopen(wizard_filename, "r");
+                       if (fp != NULL) {
+                               fgets(buf, sizeof buf, fp);
+                               buf[strlen(buf)-1] = 0;
+                               fclose(fp);
+                               if (atoi(buf) == serv_info.serv_rev_level) {
+                                       setup_wizard = 1; /* already run */
+                               }
                        }
                }
-       }
 
-       if (!setup_wizard) {
-               http_redirect("/setup_wizard");
+               if (!setup_wizard) {
+                       http_redirect("/setup_wizard");
+               }
        }
 
        /*
index 47e89b8ec849de875fd667e6a6190ee2d5693660..464576c532b6914503b7dfae4f94bbc966ea6801 100644 (file)
 #include "webcit.h"
 
 
-
 /*
  */
 void do_setup_wizard(void)
 {
+       char *step;
+       FILE *fp;
+
+       step = bstr("step");
+
+       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, 1, 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("<IMG SRC=\"/static/citadel-logo.gif\" WIDTH=64 HEIGHT=64 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("<div id=\"fix_scrollbar_bug\">"
+               "<form method=\"post\" action=\"/setup_wizard\">\n"
+       );
 
-       wprintf("wow");
+       wprintf("<div align=center>"
+               "This is where the setup wizard will be placed.<br>\n"
+               "For now, just click Finish.<br><br>\n"
+       );
 
-       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("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Next\">\n");
+       wprintf("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Finish\">\n");
+
+       wprintf("</form></div></div>\n");
        wDumpContent(1);
 }