Back to index

webcit  8.12-dfsg
setup_wizard.c
Go to the documentation of this file.
00001 /*
00002  * First-time setup wizard
00003  */
00004 
00005 #include "webcit.h"
00006 
00007 void do_setup_wizard(void)
00008 {
00009        char *step;
00010        FILE *fp;
00011 
00012        step = bstr("step");
00013 
00014        if (!strcasecmp(step, "Finish")) {
00015               fp = fopen(wizard_filename, "w");
00016               if (fp != NULL) {
00017                      fprintf(fp, "%d\n", WC->serv_info->serv_rev_level);
00018                      fclose(fp);
00019               }
00020               do_welcome();
00021               return;
00022        }
00023 
00024        output_headers(1, 1, 1, 0, 0, 0);
00025 
00026        wc_printf("<div id=\"room_banner_override\">\n");
00027        wc_printf("<img src=\"static/citadel-logo.gif\" WIDTH=64 HEIGHT=64");
00028        wc_printf("<h1>&nbsp;First time setup</h1>");
00029        wc_printf("</div>\n");
00030 
00031        wc_printf("<div id=\"content\" class=\"service\">\n");
00032 
00033        wc_printf("<form method=\"post\" action=\"setup_wizard\">\n");
00034        wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
00035 
00036        wc_printf("<div align=center>"
00037               "This is where the setup wizard will be placed.<br>\n"
00038               "For now, just click Finish.<br><br>\n"
00039        );
00040 
00041        wc_printf("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Next\">\n");
00042        wc_printf("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Finish\">\n");
00043 
00044        wc_printf("</form></div>\n");
00045        wDumpContent(1);
00046 }
00047 
00048 void 
00049 InitModule_SETUP_WIZARD
00050 (void)
00051 {
00052        WebcitAddUrlHandler(HKEY("setup_wizard"), "", 0, do_setup_wizard, 0);
00053 }