Mailing list header changes (fuck you Google)
[citadel.git] / webcit / setup_wizard.c
1 /*
2  * First-time setup wizard
3  */
4
5 #include "webcit.h"
6
7 void do_setup_wizard(void)
8 {
9         char *step;
10         FILE *fp;
11
12         step = bstr("step");
13
14         if (!strcasecmp(step, "Finish")) {
15                 fp = fopen(wizard_filename, "w");
16                 if (fp != NULL) {
17                         fprintf(fp, "%d\n", WC->serv_info->serv_rev_level);
18                         fclose(fp);
19                 }
20                 do_welcome();
21                 return;
22         }
23
24         output_headers(1, 1, 1, 0, 0, 0);
25
26         wc_printf("<div id=\"room_banner_override\">\n");
27         wc_printf("<img src=\"static/citadel-logo.gif\" WIDTH=64 HEIGHT=64");
28         wc_printf("<h1>&nbsp;First time setup</h1>");
29         wc_printf("</div>\n");
30
31         wc_printf("<div id=\"content\" class=\"service\">\n");
32
33         wc_printf("<form method=\"post\" action=\"setup_wizard\">\n");
34         wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
35
36         wc_printf("<div align=center>"
37                 "This is where the setup wizard will be placed.<br>\n"
38                 "For now, just click Finish.<br><br>\n"
39         );
40
41         wc_printf("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Next\">\n");
42         wc_printf("<INPUT TYPE=\"submit\" NAME=\"step\" VALUE=\"Finish\">\n");
43
44         wc_printf("</form></div>\n");
45         wDumpContent(1);
46 }
47
48 void 
49 InitModule_SETUP_WIZARD
50 (void)
51 {
52         WebcitAddUrlHandler(HKEY("setup_wizard"), "", 0, do_setup_wizard, 0);
53 }