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