char buf[256];
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "_top");
/* Da banner */
wprintf("<CENTER><TABLE border=0 width=100%><TR><TD>\n");
wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Login\">\n");
wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"New User\">\n");
wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Exit\">\n");
+
+ wprintf("<BR><INPUT TYPE=\"checkbox\" NAME=\"noframes\">");
+ wprintf("<FONT SIZE=-1>Check here to disable frames</FONT>\n");
wprintf("</FORM></CENTER>\n");
/* Da instructions */
wprintf("and <i>cookies</i>.\n");
wprintf("</EM></UL>\n");
- wprintf("</BODY></HTML>\n");
- wDumpContent();
+ wDumpContent(1);
}
char buf[256];
int need_regi = 0;
+
+ if (!strcasecmp(bstr("noframes"), "on"))
+ noframes = 1;
+ else
+ noframes = 0;
+
if (!strcasecmp(bstr("action"), "Exit")) {
do_logout();
}
display_reg(1);
}
else {
- output_static("frameset.html");
+ do_welcome();
}
}
else {
}
void do_welcome(void) {
- printf("HTTP/1.0 200 OK\n");
- output_headers(1);
- wprintf("<CENTER><H1>");
- escputs(wc_username);
- wprintf("</H1>\n");
- /* FIX add user stats here */
-
- wprintf("<HR>");
- /* FIX --- what should we put here? the main menu,
- * or new messages in the lobby?
- */
- embed_main_menu();
-
- wprintf("</BODY></HTML>\n");
- wDumpContent();
+
+
+ fprintf(stderr, "DO_WELCOME CALLED, NOFRAMES=%d\n", noframes);
+
+ if (noframes) {
+ printf("HTTP/1.0 200 OK\n");
+ output_headers(1, "_top");
+ wprintf("<CENTER><H1>");
+ escputs(wc_username);
+ wprintf("</H1>\n");
+ /* FIX add user stats here */
+
+ wprintf("<HR>");
+ embed_main_menu();
+
+ wDumpContent(1);
+ }
+
+ else {
+ output_static("frameset.html");
+ }
}
strcpy(wc_username, "");
strcpy(wc_password, "");
strcpy(wc_roomname, "");
- strcpy(wc_host, "");
- strcpy(wc_port, "");
printf("HTTP/1.0 200 OK\n");
- printf("X-WebCit-Session: close\n");
- output_headers(1);
+ output_headers(2, "_top"); /* note "2" causes cookies to be unset */
wprintf("<CENTER>");
serv_puts("MESG goodbye");
if (buf[0]=='1') fmout(NULL);
else wprintf("Goodbye\n");
- wprintf("<HR><A HREF=\"/\">Log in again</A>\n");
- wprintf("</CENTER></BODY></HTML>\n");
- wDumpContent();
+ wprintf("<HR><A HREF=\"/\">Log in again</A></CENTER>\n");
+ wDumpContent(1);
serv_puts("QUIT");
exit(0);
}
int a;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
strcpy(buf,bstr("user"));
if (strlen(buf)>0) if (strlen(bstr("axlevel"))>0) {
serv_gets(buf);
if (buf[0]!='3') {
- wprintf("<EM>%s</EM><BR></BODY></HTML>\n", &buf[4]);
- wDumpContent();
+ wprintf("<EM>%s</EM><BR>\n", &buf[4]);
+ wDumpContent(1);
return;
}
urlesc(user), a, axdefs[a]);
}
wprintf("</TR></TABLE><CENTER><BR>\n");
- wDumpContent();
+ wDumpContent(1);
}
int a;
printf("HTTP/1.0 200 OK\n");
- output_headers(1);
+ output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
}
wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Register\">\n");
wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Cancel\">\n");
- wprintf("</CENTER></BODY></HTML>\n");
- wDumpContent();
+ wprintf("</CENTER>\n");
+ wDumpContent(1);
}
/*
serv_puts("000");
if (atoi(bstr("during_login"))) {
- output_static("frameset.html");
+ do_welcome();
}
else {
display_error("Registration information has been saved.");
}
}
+
+
+
+
+
+/*
+ * display form for changing your password
+ */
+void display_changepw(void) {
+ char buf[256];
+
+ printf("HTTP/1.0 200 OK\n");
+ output_headers(1, "bottom");
+
+ wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
+ wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+ wprintf("<B>Change your password</B>\n");
+ wprintf("</FONT></TD></TR></TABLE>\n");
+
+ wprintf("<CENTER>");
+ serv_puts("MESG changepw");
+ serv_gets(buf);
+ if (buf[0]=='1') fmout(NULL);
+
+ wprintf("<FORM ACTION=\"changepw\" METHOD=\"POST\">\n");
+ wprintf("<CENTER><TABLE border><TR><TD>Enter new password:</TD>\n");
+ wprintf("<TD><INPUT TYPE=\"password\" NAME=\"newpass1\" VALUE=\"\" MAXLENGTH=\"20\"></TD></TR>\n");
+ wprintf("<TR><TD>Enter it again to confirm:</TD>\n");
+ wprintf("<TD><INPUT TYPE=\"password\" NAME=\"newpass2\" VALUE=\"\" MAXLENGTH=\"20\"></TD></TR>\n");
+ wprintf("</TABLE>\n");
+ wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Change\">\n");
+ wprintf("<INPUT type=\"submit\" NAME=\"action\" VALUE=\"Cancel\">\n");
+ wprintf("</CENTER>\n");
+ wDumpContent(1);
+ }
+
+/*
+ * change password
+ */
+void changepw(void) {
+ char buf[256];
+ char newpass1[32], newpass2[32];
+
+ if (strcmp(bstr("action"),"Change")) {
+ display_error("Cancelled. Password was not changed.");
+ return;
+ }
+
+ strcpy(newpass1, bstr("newpass1"));
+ strcpy(newpass2, bstr("newpass2"));
+
+ if (strcasecmp(newpass1, newpass2)) {
+ display_error("They don't match. Password was not changed.");
+ return;
+ }
+
+ serv_printf("SETP %s", newpass1);
+ serv_gets(buf);
+ if (buf[0]=='2') display_success(&buf[4]);
+ else display_error(&buf[4]);
+ }