10 #include <sys/types.h>
15 * This struct holds a list of rooms for <G>oto operations.
25 * This struct holds a list of rooms for client display.
29 struct roomlisting *lnext;
30 struct roomlisting *rnext;
38 char floorlist[128][256];
45 struct march *march = NULL;
48 * load the list of floors
50 void load_floorlist(void)
55 for (a = 0; a < 128; ++a)
61 strcpy(floorlist[0], "Main Floor");
64 while (serv_gets(buf), strcmp(buf, "000")) {
65 extract(floorlist[extract_int(buf, 0)], buf, 1);
71 * remove a room from the march list
73 void remove_march(char *aaa)
75 struct march *mptr, *mptr2;
80 if (!strcasecmp(march->march_name, aaa)) {
87 for (mptr = march; mptr != NULL; mptr = mptr->next) {
88 if (!strcasecmp(mptr->march_name, aaa)) {
89 mptr2->next = mptr->next;
102 void room_tree_list(struct roomlisting *rp)
110 if (rp->lnext != NULL) {
111 room_tree_list(rp->lnext);
113 strcpy(rmname, rp->rlname);
116 wprintf("<A HREF=\"/dotgoto&room=");
118 wprintf("\" TARGET=\"top\">");
120 if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
122 else if (f & QR_DIRECTORY)
124 else if (f & QR_NETWORK)
128 wprintf("</A><TT> </TT>\n");
130 if (rp->rnext != NULL) {
131 room_tree_list(rp->rnext);
138 * Room ordering stuff (compare first by floor, then by order)
140 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
142 if ((r1 == NULL) && (r2 == NULL))
148 if (r1->rlfloor < r2->rlfloor)
150 if (r1->rlfloor > r2->rlfloor)
152 if (r1->rlorder < r2->rlorder)
154 if (r1->rlorder > r2->rlorder)
161 * Common code for all room listings
163 void listrms(char *variety)
168 struct roomlisting *rl = NULL;
169 struct roomlisting *rp;
170 struct roomlisting *rs;
173 /* Ask the server for a room list */
180 while (serv_gets(buf), strcmp(buf, "000")) {
182 rp = malloc(sizeof(struct roomlisting));
183 extract(rp->rlname, buf, 0);
184 rp->rlflags = extract_int(buf, 1);
185 rp->rlfloor = extract_int(buf, 2);
186 rp->rlorder = extract_int(buf, 3);
195 if (rordercmp(rp, rs) < 0) {
196 if (rs->lnext == NULL) {
203 if (rs->rnext == NULL) {
215 /* If no rooms were listed, print an nbsp to make the cell
216 * borders show up anyway.
218 if (num_rooms == 0) wprintf(" ");
230 * list all rooms by floor
232 void list_all_rooms_by_floor(void)
239 printf("HTTP/1.0 200 OK\n");
242 wprintf("<TABLE width=100% border><TR><TH>Floor</TH>");
243 wprintf("<TH><FONT FACE=\"Arial,Helvetica,sans-serif\">Rooms with new messages</FONT></TH>");
244 wprintf("<TH><FONT FACE=\"Arial,Helvetica,sans-serif\">Rooms with no new messages</FONT></TH></TR>\n");
246 for (a = 0; a < 128; ++a)
247 if (floorlist[a][0] != 0) {
249 /* Floor name column */
250 wprintf("<TR><TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
252 serv_printf("OIMG _floorpic_|%d", a);
257 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
258 a, &floorlist[a][0]);
260 escputs(&floorlist[a][0]);
263 wprintf("</FONT></TD>");
265 /* Rooms with new messages column */
266 wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
267 sprintf(buf, "LKRN %d", a);
269 wprintf("</FONT></TD>\n<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
271 /* Rooms with old messages column */
272 sprintf(buf, "LKRO %d", a);
274 wprintf("</FONT></TD></TR>\n");
276 wprintf("</TABLE>\n");
282 * list all forgotten rooms
284 void zapped_list(void)
286 printf("HTTP/1.0 200 OK\n");
288 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
289 wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\" SIZE=+1 COLOR=\"FFFFFF\"");
290 wprintf("<B>Zapped (forgotten) rooms</B>\n");
291 wprintf("</FONT></TD></TR></TABLE><BR>\n");
293 wprintf("<BR><BR>\n");
294 wprintf("Click on any room to un-zap it and goto that room.\n");
300 * read this room's info file (set v to 1 for verbose mode)
312 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
318 void embed_room_banner(char *got) {
323 serv_printf("GOTO %s", wc_roomname);
328 wprintf("<CENTER><TABLE border=0><TR>");
330 if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) {
331 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
332 wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0></A></TD>");
334 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\"><FONT SIZE=+2>%s</FONT><BR>", wc_roomname);
335 wprintf("%d new of %d messages</FONT></TD>\n",
336 extract_int(&got[4], 1),
337 extract_int(&got[4], 2));
339 /* Display room graphic. The server doesn't actually
340 * need the room name, but we supply it in order to
341 * keep the browser from using a cached graphic from
344 serv_puts("OIMG _roompic_");
347 wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
348 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
349 escputs(wc_roomname);
350 wprintf("\"></FONT></TD>");
354 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\">");
356 wprintf("</FONT></TD>");
358 wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
359 wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
360 wprintf("</TR></TABLE></CENTER>\n");
368 * generic routine to take the session to a new room
370 * display_name values: 0 = goto only
371 * 1 = goto and display
374 void gotoroom(char *gname, int display_name)
377 static long ls = (-1L);
381 printf("HTTP/1.0 200 OK\n");
382 printf("Pragma: no-cache\n");
383 printf("Cache-Control: no-store\n");
386 wprintf("<HTML><HEAD></HEAD>\n<BODY ");
388 /* automatically fire up a read-new-msgs in the bottom frame */
390 wprintf("onload=parent.frames.bottom.location=\"/readnew\" ");
392 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
394 if (display_name != 2) {
395 /* store ungoto information */
396 strcpy(ugname, wc_roomname);
399 /* move to the new room */
400 serv_printf("GOTO %s", gname);
403 serv_puts("GOTO _BASEROOM_");
408 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
413 extract(wc_roomname, &buf[4], 0);
414 room_flags = extract_int(&buf[4], 4);
415 /* highest_msg_read = extract_int(&buf[4],6);
416 maxmsgnum = extract_int(&buf[4],5);
417 is_mail = (char) extract_int(&buf[4],7); */
418 ls = extract_long(&buf[4], 6);
421 is_room_aide = is_aide;
423 is_room_aide = (char) extract_int(&buf[4], 8);
425 remove_march(wc_roomname);
426 if (!strcasecmp(gname, "_BASEROOM_"))
429 /* Display the room banner */
431 embed_room_banner(buf);
434 strcpy(wc_roomname, wc_roomname);
439 * Locate the room on the march list which we most want to go to. Each room
440 * is measured given a "weight" of preference based on various factors.
442 char *pop_march(int desired_floor)
444 static char TheRoom[64];
446 int TheOrder = 32767;
449 struct march *mptr = NULL;
451 strcpy(TheRoom, "_BASEROOM_");
455 for (mptr = march; mptr != NULL; mptr = mptr->next) {
457 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
458 weight = weight + 10000;
459 if (mptr->march_floor == desired_floor)
460 weight = weight + 5000;
462 weight = weight + ((128 - (mptr->march_floor)) * 128);
463 weight = weight + (128 - (mptr->march_order));
465 if (weight > TheWeight) {
467 strcpy(TheRoom, mptr->march_name);
468 TheFloor = mptr->march_floor;
469 TheOrder = mptr->march_order;
477 /* Goto next room having unread messages.
478 * We want to skip over rooms that the user has already been to, and take the
479 * user back to the lobby when done. The room we end up in is placed in
480 * newroom - which is set to 0 (the lobby) initially.
481 * We start the search in the current room rather than the beginning to prevent
482 * two or more concurrent users from dragging each other back to the same room.
487 struct march *mptr, *mptr2;
490 /* First check to see if the march-mode list is already allocated.
491 * If it is, pop the first room off the list and go there.
498 while (serv_gets(buf), strcmp(buf, "000")) {
499 mptr = (struct march *) malloc(sizeof(struct march));
501 extract(mptr->march_name, buf, 0);
502 mptr->march_floor = extract_int(buf, 2);
503 mptr->march_order = extract_int(buf, 3);
508 while (mptr2->next != NULL)
513 /* add _BASEROOM_ to the end of the march list, so the user will end up
514 * in the system base room (usually the Lobby>) at the end of the loop
516 mptr = (struct march *) malloc(sizeof(struct march));
518 strcpy(mptr->march_name, "_BASEROOM_");
523 while (mptr2->next != NULL)
528 * ...and remove the room we're currently in, so a <G>oto doesn't make us
529 * walk around in circles
531 remove_march(wc_roomname);
534 strcpy(next_room, pop_march(-1));
536 strcpy(next_room, "_BASEROOM_");
539 /* In noframes mode, we goto the room silently, then do a
540 * read-new-messages which causes the banner to show up anyway.
543 gotoroom(next_room, 0);
546 /* In frames mode, we let gotoroom() bring up the banner, which then
547 * uses JavaScript to bring up the new-messages display in the
550 gotoroom(next_room, 1);
557 * mark all messages in current room as having been read
559 void slrp_highest(void)
564 serv_puts("SLRP HIGHEST");
567 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
574 * un-goto the previous room
580 if (!strcmp(ugname, "")) {
581 gotoroom(wc_roomname, 1);
584 serv_printf("GOTO %s", ugname);
587 gotoroom(wc_roomname, 1);
591 serv_printf("SLRP %ld", uglsn);
600 * display the form for editing a room
602 void display_editroom(void)
606 char er_password[10];
608 char er_roomaide[26];
617 display_error(&buf[4]);
620 extract(er_name, &buf[4], 0);
621 extract(er_password, &buf[4], 1);
622 extract(er_dirname, &buf[4], 2);
623 er_flags = extract_int(&buf[4], 3);
624 er_floor = extract_int(&buf[4], 4);
627 printf("HTTP/1.0 200 OK\n");
630 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
631 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
632 wprintf("<B>Edit this room</B>\n");
633 wprintf("</FONT></TD></TR></TABLE>\n");
635 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
637 wprintf("<UL><LI>Name of room: ");
638 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
640 wprintf("<LI>Resides on floor: ");
642 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
643 for (i = 0; i < 128; ++i)
644 if (strlen(floorlist[i]) > 0) {
647 wprintf("SELECTED ");
648 wprintf("VALUE=\"%d\">", i);
649 escputs(floorlist[i]);
650 wprintf("</OPTION>\n");
652 wprintf("</SELECT>\n");
654 wprintf("<LI>Type of room:<UL>\n");
656 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
657 if ((er_flags & QR_PRIVATE) == 0)
659 wprintf("> Public room\n");
661 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
662 if ((er_flags & QR_PRIVATE) &&
663 (er_flags & QR_GUESSNAME))
665 wprintf("> Private - guess name\n");
667 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
668 if ((er_flags & QR_PRIVATE) &&
669 (er_flags & QR_PASSWORDED))
671 wprintf("> Private - require password:\n");
672 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
674 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
675 if ((er_flags & QR_PRIVATE)
676 && ((er_flags & QR_GUESSNAME) == 0)
677 && ((er_flags & QR_PASSWORDED) == 0))
679 wprintf("> Private - invitation only\n");
681 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
682 wprintf("> If private, cause current users to forget room\n");
686 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
687 if (er_flags & QR_PREFONLY)
689 wprintf("> Preferred users only\n");
691 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
692 if (er_flags & QR_READONLY)
694 wprintf("> Read-only room\n");
696 /* directory stuff */
697 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
698 if (er_flags & QR_DIRECTORY)
700 wprintf("> File directory room\n");
702 wprintf("<UL><LI>Directory name: ");
703 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
705 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
706 if (er_flags & QR_UPLOAD)
708 wprintf("> Uploading allowed\n");
710 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
711 if (er_flags & QR_DOWNLOAD)
713 wprintf("> Downloading allowed\n");
715 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
716 if (er_flags & QR_VISDIR)
718 wprintf("> Visible directory</UL>\n");
720 /* end of directory stuff */
722 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
723 if (er_flags & QR_NETWORK)
725 wprintf("> Network shared room\n");
727 /* start of anon options */
729 wprintf("<LI>Anonymous messages<UL>\n");
731 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
732 if (((er_flags & QR_ANONONLY) == 0)
733 && ((er_flags & QR_ANONOPT) == 0))
735 wprintf("> No anonymous messages\n");
737 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
738 if (er_flags & QR_ANONONLY)
740 wprintf("> All messages are anonymous\n");
742 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
743 if (er_flags & QR_ANONOPT)
745 wprintf("> Prompt user when entering messages</UL>\n");
747 /* end of anon options */
749 wprintf("<LI>Room aide: \n");
753 wprintf("<EM>%s</EM>\n", &buf[4]);
755 extract(er_roomaide, &buf[4], 0);
756 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
759 wprintf("</UL><CENTER>\n");
760 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
761 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
762 wprintf("</CENTER>\n");
769 * save new parameters for a room
775 char er_password[10];
777 char er_roomaide[26];
783 if (strcmp(bstr("sc"), "OK")) {
784 display_error("Cancelled. Changes were not saved.");
791 display_error(&buf[4]);
794 extract(er_name, &buf[4], 0);
795 extract(er_password, &buf[4], 1);
796 extract(er_dirname, &buf[4], 2);
797 er_flags = extract_int(&buf[4], 3);
799 strcpy(er_roomaide, bstr("er_roomaide"));
800 if (strlen(er_roomaide) == 0) {
804 strcpy(er_roomaide, "");
806 extract(er_roomaide, &buf[4], 0);
809 strcpy(buf, bstr("er_name"));
812 strcpy(er_name, buf);
814 strcpy(buf, bstr("er_password"));
817 strcpy(er_password, buf);
819 strcpy(buf, bstr("er_dirname"));
822 strcpy(er_dirname, buf);
824 strcpy(buf, bstr("type"));
825 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
827 if (!strcmp(buf, "invonly")) {
828 er_flags |= (QR_PRIVATE);
830 if (!strcmp(buf, "guessname")) {
831 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
833 if (!strcmp(buf, "passworded")) {
834 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
836 if (!strcmp(bstr("prefonly"), "yes")) {
837 er_flags |= QR_PREFONLY;
839 er_flags &= ~QR_PREFONLY;
842 if (!strcmp(bstr("readonly"), "yes")) {
843 er_flags |= QR_READONLY;
845 er_flags &= ~QR_READONLY;
848 if (!strcmp(bstr("network"), "yes")) {
849 er_flags |= QR_NETWORK;
851 er_flags &= ~QR_NETWORK;
854 if (!strcmp(bstr("directory"), "yes")) {
855 er_flags |= QR_DIRECTORY;
857 er_flags &= ~QR_DIRECTORY;
860 if (!strcmp(bstr("ulallowed"), "yes")) {
861 er_flags |= QR_UPLOAD;
863 er_flags &= ~QR_UPLOAD;
866 if (!strcmp(bstr("dlallowed"), "yes")) {
867 er_flags |= QR_DOWNLOAD;
869 er_flags &= ~QR_DOWNLOAD;
872 if (!strcmp(bstr("visdir"), "yes")) {
873 er_flags |= QR_VISDIR;
875 er_flags &= ~QR_VISDIR;
878 strcpy(buf, bstr("anon"));
880 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
881 if (!strcmp(buf, "anononly"))
882 er_flags |= QR_ANONONLY;
883 if (!strcmp(buf, "anon2"))
884 er_flags |= QR_ANONOPT;
887 if (!strcmp(bstr("bump"), "yes"))
890 er_floor = atoi(bstr("er_floor"));
892 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
893 er_name, er_password, er_dirname, er_flags, bump, er_floor);
897 display_error(&buf[4]);
900 gotoroom(er_name, 0);
902 if (strlen(er_roomaide) > 0) {
903 sprintf(buf, "SETA %s", er_roomaide);
907 display_error(&buf[4]);
911 gotoroom(er_name, 1);
917 * display the form for entering a new room
919 void display_entroom(void)
927 display_error(&buf[4]);
930 printf("HTTP/1.0 200 OK\n");
933 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
934 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
935 wprintf("<B>Enter (create) a new room</B>\n");
936 wprintf("</FONT></TD></TR></TABLE>\n");
938 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
940 wprintf("<UL><LI>Name of room: ");
941 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
943 wprintf("<LI>Type of room:<UL>\n");
945 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
946 wprintf("CHECKED > Public room\n");
948 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
949 wprintf("> Private - guess name\n");
951 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
952 wprintf("> Private - require password:\n");
953 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
955 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
956 wprintf("> Private - invitation only\n");
958 wprintf("<CENTER>\n");
959 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
960 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
961 wprintf("</CENTER>\n");
962 wprintf("</FORM>\n");
976 char er_password[10];
979 if (strcmp(bstr("sc"), "OK")) {
980 display_error("Cancelled. No new room was created.");
983 strcpy(er_name, bstr("er_name"));
984 strcpy(er_type, bstr("type"));
985 strcpy(er_password, bstr("er_password"));
988 if (!strcmp(er_type, "guessname"))
990 if (!strcmp(er_type, "passworded"))
992 if (!strcmp(er_type, "invonly"))
995 sprintf(buf, "CRE8 1|%s|%d|%s", er_name, er_num_type, er_password);
999 display_error(&buf[4]);
1002 gotoroom(er_name, 1);
1007 * display the screen to enter a private room
1009 void display_private(char *rname, int req_pass)
1012 printf("HTTP/1.0 200 OK\n");
1015 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1016 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1017 wprintf("<B>Goto a private room</B>\n");
1018 wprintf("</FONT></TD></TR></TABLE>\n");
1020 wprintf("<CENTER>\n");
1021 wprintf("If you know the name of a hidden (guess-name) or\n");
1022 wprintf("passworded room, you can enter that room by typing\n");
1023 wprintf("its name below. Once you gain access to a private\n");
1024 wprintf("room, it will appear in your regular room listings\n");
1025 wprintf("so you don't have to keep returning here.\n");
1026 wprintf("<BR><BR>");
1028 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
1030 wprintf("<TABLE border><TR><TD>");
1031 wprintf("Enter room name:</TD><TD>");
1032 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1035 wprintf("</TD></TR><TR><TD>");
1036 wprintf("Enter room password:</TD><TD>");
1037 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1039 wprintf("</TD></TR></TABLE>\n");
1041 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1042 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1043 wprintf("</FORM>\n");
1048 * goto a private room
1050 void goto_private(void)
1055 if (strcasecmp(bstr("sc"), "OK")) {
1056 display_main_menu();
1059 strcpy(hold_rm, wc_roomname);
1060 strcpy(buf, "GOTO ");
1061 strcat(buf, bstr("gr_name"));
1063 strcat(buf, bstr("gr_pass"));
1067 if (buf[0] == '2') {
1068 gotoroom(bstr("gr_name"), 1);
1071 if (!strncmp(buf, "540", 3)) {
1072 display_private(bstr("gr_name"), 1);
1075 printf("HTTP/1.0 200 OK\n");
1077 wprintf("%s\n", &buf[4]);
1084 * display the screen to zap a room
1086 void display_zap(void)
1088 printf("HTTP/1.0 200 OK\n");
1091 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1092 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1093 wprintf("<B>Zap (forget) the current room</B>\n");
1094 wprintf("</FONT></TD></TR></TABLE>\n");
1096 wprintf("If you select this option, <em>%s</em> will ", wc_roomname);
1097 wprintf("disappear from your room list. Is this what you wish ");
1098 wprintf("to do?<BR>\n");
1100 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1101 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1102 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1103 wprintf("</FORM>\n");
1115 if (strcmp(bstr("sc"), "OK")) {
1116 display_main_menu();
1119 serv_printf("GOTO %s", wc_roomname);
1121 if (buf[0] != '2') {
1122 display_error(&buf[4]);
1127 if (buf[0] != '2') {
1128 display_error(&buf[4]);
1131 gotoroom(bstr("_BASEROOM_"), 1);
1138 * Confirm deletion of the current room
1140 void confirm_delete_room(void)
1144 serv_puts("KILL 0");
1146 if (buf[0] != '2') {
1147 display_error(&buf[4]);
1150 printf("HTTP/1.0 200 OK\n");
1152 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1153 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1154 wprintf("<B>Confirm deletion of room</B>\n");
1155 wprintf("</FONT></TD></TR></TABLE>\n");
1157 wprintf("<CENTER>");
1158 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1160 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1161 escputs(wc_roomname);
1162 wprintf("</FONT>?<BR>\n");
1164 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1165 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1167 wprintf("</FORM></CENTER>\n");
1173 * Delete the current room
1175 void delete_room(void)
1180 strcpy(sc, bstr("sc"));
1182 if (strcasecmp(sc, "Delete")) {
1183 display_error("Cancelled. This room was not deleted.");
1186 serv_puts("KILL 1");
1188 if (buf[0] != '2') {
1189 display_error(&buf[4]);
1191 gotoroom("_BASEROOM_", 1);