/*
* This function needs to get called whenever a PASS or NEWU succeeds
*/
-void become_logged_in(char *user, char *pass) {
-
+void become_logged_in(char *user, char *pass, char *serv_response) {
logged_in = 1;
- strcpy(wc_username, user);
+ extract(wc_username, &serv_response[4], 0);
strcpy(wc_password, pass);
-
+ axlevel = extract_int(&serv_response[4], 1);
+ if (axlevel >=6) is_aide = 1;
}
serv_printf("PASS %s", bstr("pass"));
serv_gets(buf);
if (buf[0]=='2') {
- extract(actual_username, &buf[4], 0);
- become_logged_in(actual_username, bstr("pass"));
+ become_logged_in(bstr("name"),
+ bstr("pass"), buf);
}
}
}
wprintf("List known rooms</B></A><BR>\n");
wprintf("Where can I go from here?</LI>\n");
- wprintf("<LI><B><A HREF=\"/gotonext\">\n");
+ wprintf("<LI><B><A HREF=\"/gotonext\" TARGET=\"top\">\n");
wprintf("Goto next room</B></A><BR>\n");
wprintf("...with <EM>unread</EM> messages</LI>\n");
- wprintf("<LI><B><A HREF=\"/skip\">\n");
+ wprintf("<LI><B><A HREF=\"/skip\" TARGET=\"top\">\n");
wprintf("Skip to next room</B></A><BR>\n");
wprintf("(come back here later)</LI>\n");
- /* ungoto not supported yet
- if ( (strlen(ugname)>0) && (strucmp(ugname,room_name)) ) {
- wprintf("<LI><B><A HREF=\"/ungoto\">\n");
+ if ( (strlen(ugname)>0) && (strcasecmp(ugname,wc_roomname)) ) {
+ wprintf("<LI><B><A HREF=\"/ungoto\" TARGET=\"top\">\n");
wprintf("Ungoto</B></A><BR>\n");
wprintf("(oops! Back to %s)</LI>\n",ugname);
}
- */
wprintf("</UL>\n");
wprintf("</CENTER>\n");
}
+/*
+ * advanced options
+ */
+void embed_advanced_menu() {
+
+wprintf("<TABLE WIDTH=100%><TR VALIGN=TOP><TD>");
+
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Interaction</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+wprintf("<UL>");
+wprintf("<LI><A HREF=\"/display_page\">\n");
+wprintf("Page another user</A>\n");
+
+wprintf("<LI><A HREF=\"/chat\">");
+wprintf("Chat with other online users</A>\n");
+
+wprintf("</UL>\n");
+
+wprintf("</TD><TD>");
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Your info</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+wprintf("<UL>");
+wprintf("<LI><A HREF=\"/display_editbio\">\n");
+wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
+
+wprintf("<LI><A HREF=\"/display_editpic\">\n");
+wprintf("Edit your online photo</A>\n");
+
+wprintf("<LI><A HREF=\"/display_reg\">\n");
+wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
+
+wprintf("<LI><A HREF=\"/display_changepw\">\n");
+wprintf("Change your password</A>\n");
+
+wprintf("</UL>\n");
+
+
+wprintf("</TD></TR><TR VALIGN=TOP><TD>");
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Advanced room commands</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+wprintf("<UL>");
+wprintf("<LI><A HREF=\"/display_private\">\n");
+wprintf("Go to a 'hidden' room</A>\n");
+
+wprintf("<LI><A HREF=\"/display_entroom\">");
+wprintf("Create a new room</A>\n");
+
+wprintf("<LI><A HREF=\"/display_zap\">");
+wprintf("Zap (forget) this room (%s)</A>\n", wc_roomname);
+
+wprintf("<LI><A HREF=\"/zapped_list\">");
+wprintf("List all forgotten rooms</A>\n");
+
+wprintf("</UL>\n");
+
+wprintf("</TD><TD>");
+
+if ((axlevel>=6) || (is_room_aide)) {
+ wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007777><TR><TD>");
+ wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+ wprintf("<B>Administrative functions</B>\n");
+ wprintf("</FONT></TD></TR></TABLE>\n");
+
+ wprintf("<UL>");
+ wprintf("<LI><A HREF=\"/display_editroom\">\n");
+ wprintf("Edit this room</A>\n");
+
+ wprintf("<LI><A HREF=\"/confirm_delete_room\">\n");
+ wprintf("Delete this room</A>\n");
+
+ wprintf("<LI><A HREF=\"/display_editroompic\">\n");
+ wprintf("Set or change the graphic for this room's banner</A>\n");
+
+ wprintf("<LI><A HREF=\"/display_editinfo\">\n");
+ wprintf("Edit this room's Info file</A>\n");
+
+ if (axlevel>=6) {
+ wprintf("<LI><A HREF=\"/validate\">\n");
+ wprintf("Validate new users</A>\n");
+
+ wprintf("<LI><A HREF=\"/display_editfloorpic\">\n");
+ wprintf("Set or change a floor label graphic</A>\n");
+
+ wprintf("<LI><A HREF=\"/display_netconf\">\n");
+ wprintf("Configure networking with other systems</A>\n");
+ }
+
+ wprintf("</UL>\n");
+ }
+
+wprintf("</TD></TR></TABLE>");
+
+wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
+wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
+wprintf("<B>Basic commands</B>\n");
+wprintf("</FONT></TD></TR></TABLE>\n");
+
+ }
+
+
+
+
/*
* menu of commands (as a page)
*/
wprintf("</BODY></HTML>\n");
wDumpContent();
}
+
+
+void display_advanced_menu() {
+ printf("HTTP/1.0 200 OK\n");
+ output_headers();
+ wprintf("<HTML><HEAD><TITLE>WebCit main menu</TITLE></HEAD><BODY>\n");
+ embed_advanced_menu();
+ embed_main_menu();
+ wprintf("</BODY></HTML>\n");
+ wDumpContent();
+ }
int TransactionCount = 0;
int connected = 0;
int logged_in = 0;
+int axlevel;
struct webcontent *wlist = NULL;
struct webcontent *wlast = NULL;
serv_printf("PASS %s", c_password);
serv_gets(buf);
if (buf[0]=='2') {
- extract(c_username, &buf[4], 0);
- become_logged_in(c_username, c_password);
+ become_logged_in(c_username, c_password, buf);
}
}
}
display_main_menu();
}
+ else if (!strncasecmp(cmd, "GET /advanced", 13)) {
+ display_advanced_menu();
+ }
+
else if (!strncasecmp(cmd, "GET /whobbs", 11)) {
whobbs();
}
}
else if (!strncasecmp(cmd, "GET /gotonext", 13)) {
+ slrp_highest();
+ gotonext();
+ }
+
+ else if (!strncasecmp(cmd, "GET /skip", 9)) {
gotonext();
}
}
else if (!strncasecmp(cmd, "GET /dotgoto", 12)) {
+ slrp_highest();
dotgoto();
}