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) {
54 for (a=0; a<128; ++a) floorlist[a][0] = 0;
59 strcpy(floorlist[0],"Main Floor");
62 while (serv_gets(buf), strcmp(buf,"000")) {
63 extract(floorlist[extract_int(buf,0)],buf,1);
69 * remove a room from the march list
71 void remove_march(char *aaa)
73 struct march *mptr,*mptr2;
75 if (march==NULL) return;
77 if (!strcasecmp(march->march_name,aaa)) {
85 for (mptr=march; mptr!=NULL; mptr=mptr->next) {
86 if (!strcasecmp(mptr->march_name,aaa)) {
87 mptr2->next = mptr->next;
101 void room_tree_list(struct roomlisting *rp) {
105 if (rp == NULL) return;
107 if (rp->lnext != NULL) {
108 room_tree_list(rp->lnext);
111 strcpy(rmname, rp->rlname);
114 wprintf("<A HREF=\"/dotgoto&room=");
116 wprintf("\" TARGET=\"top\">");
118 if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) wprintf("}");
119 else if (f & QR_DIRECTORY) wprintf("]");
120 else if (f & QR_NETWORK) wprintf(")");
121 else wprintf(">");
122 wprintf("</A><TT> </TT>\n");
124 if (rp->rnext != NULL) {
125 room_tree_list(rp->rnext);
133 * Room ordering stuff (compare first by floor, then by order)
135 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
137 if ((r1==NULL)&&(r2==NULL)) return(0);
138 if (r1==NULL) return(-1);
139 if (r2==NULL) return(1);
140 if (r1->rlfloor < r2->rlfloor) return(-1);
141 if (r1->rlfloor > r2->rlfloor) return(1);
142 if (r1->rlorder < r2->rlorder) return(-1);
143 if (r1->rlorder > r2->rlorder) return(1);
149 * Common code for all room listings
151 void listrms(char *variety)
155 struct roomlisting *rl = NULL;
156 struct roomlisting *rp;
157 struct roomlisting *rs;
160 /* Ask the server for a room list */
163 if (buf[0]!='1') return;
164 while (serv_gets(buf), strcmp(buf, "000")) {
165 rp = malloc(sizeof(struct roomlisting));
166 extract(rp->rlname, buf, 0);
167 rp->rlflags = extract_int(buf, 1);
168 rp->rlfloor = extract_int(buf, 2);
169 rp->rlorder = extract_int(buf, 3);
177 else while (rp != NULL) {
178 if (rordercmp(rp, rs)<0) {
179 if (rs->lnext == NULL) {
188 if (rs->rnext == NULL) {
211 * list all rooms by floor
213 void list_all_rooms_by_floor(void) {
219 printf("HTTP/1.0 200 OK\n");
222 wprintf("<TABLE width=100% border><TR><TH>Floor</TH>");
223 wprintf("<TH>Rooms with new messages</TH>");
224 wprintf("<TH>Rooms with no new messages</TH></TR>\n");
226 for (a=0; a<128; ++a) if (floorlist[a][0]!=0) {
228 /* Floor name column */
231 serv_printf("OIMG _floorpic_|%d", a);
236 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
237 a, &floorlist[a][0]);
240 escputs(&floorlist[a][0]);
245 /* Rooms with new messages column */
247 sprintf(buf,"LKRN %d",a);
249 wprintf("</TD><TD>\n");
251 /* Rooms with old messages column */
252 sprintf(buf,"LKRO %d",a);
254 wprintf("</TD></TR>\n");
256 wprintf("</TABLE>\n");
257 wprintf("</BODY></HTML>\n");
263 * list all forgotten rooms
265 void zapped_list(void) {
266 printf("HTTP/1.0 200 OK\n");
268 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
269 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
270 wprintf("<B>Zapped (forgotten) rooms</B>\n");
271 wprintf("</FONT></TD></TR></TABLE><BR>\n");
273 wprintf("<BR><BR>\n");
274 wprintf("Click on any room to un-zap it and goto that room.\n");
275 wprintf("</BODY></HTML>\n");
281 * read this room's info file (set v to 1 for verbose mode)
289 if (buf[0]=='1') fmout(NULL);
291 if (v==1) wprintf("<EM>%s</EM><BR>\n",&buf[4]);
297 * generic routine to take the session to a new room
299 * display_name values: 0 = goto only
300 * 1 = goto and display
303 void gotoroom(char *gname, int display_name)
306 static long ls = (-1L);
310 printf("HTTP/1.0 200 OK\n");
311 printf("Window-target: top\n");
313 wprintf("<HTML><HEAD></HEAD>\n<BODY ");
315 /* automatically fire up a read-new-msgs in the bottom frame */
316 wprintf("onload=location=\"/readnew\" ");
318 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
321 if (display_name != 2) {
322 /* store ungoto information */
323 strcpy(ugname, wc_roomname);
327 /* move to the new room */
328 serv_printf("GOTO %s", gname);
331 serv_puts("GOTO _BASEROOM_");
336 wprintf("<EM>%s</EM><BR></BODY></HTML>\n",&buf[4]);
342 extract(wc_roomname,&buf[4],0);
343 room_flags = extract_int(&buf[4],4);
344 /* highest_msg_read = extract_int(&buf[4],6);
345 maxmsgnum = extract_int(&buf[4],5);
346 is_mail = (char) extract_int(&buf[4],7); */
347 ls = extract_long(&buf[4], 6);
349 if (is_aide) is_room_aide = is_aide;
350 else is_room_aide = (char) extract_int(&buf[4],8);
352 remove_march(wc_roomname);
353 if (!strcasecmp(gname,"_BASEROOM_")) remove_march(gname);
355 /* Display the room banner */
357 wprintf("<CENTER><TABLE border=0><TR>");
359 if ( (strlen(ugname)>0) && (strcasecmp(ugname,wc_roomname)) ) {
360 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
361 wprintf("<IMG SRC=\"/static/back.gif\" border=0></A></TD>");
364 wprintf("<TD VALIGN=TOP><H1>%s</H1>",wc_roomname);
365 wprintf("<FONT SIZE=-1>%d new of %d messages</FONT></TD>\n",
366 extract_int(&buf[4],1),
367 extract_int(&buf[4],2));
369 /* Display room graphic. The server doesn't actually
370 * need the room name, but we supply it in order to
371 * keep the browser from using a cached graphic from
374 serv_puts("OIMG _roompic_");
378 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
379 escputs(wc_roomname);
385 wprintf("<TD VALIGN=TOP>");
389 wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
390 wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
391 wprintf("</TR></TABLE></CENTER>\n");
392 wprintf("</BODY></HTML>\n");
396 strcpy(wc_roomname, wc_roomname);
401 * Locate the room on the march list which we most want to go to
403 char *pop_march(int desired_floor) {
404 static char TheRoom[64];
406 int TheOrder = 32767;
407 struct march *mptr = NULL;
409 strcpy(TheRoom, "_BASEROOM_");
410 if (march == NULL) return(TheRoom);
412 for (mptr = march; mptr != NULL; mptr = mptr->next) {
413 if ((strcasecmp(mptr->march_name, "_BASEROOM_"))
414 &&(!strcasecmp(TheRoom, "_BASEROOM_"))) {
415 strcpy(TheRoom, mptr->march_name);
416 TheFloor = mptr->march_floor;
417 TheOrder = mptr->march_order;
419 else if ( (mptr->march_floor == desired_floor)
420 && (TheFloor != desired_floor)
421 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
422 strcpy(TheRoom, mptr->march_name);
423 TheFloor = mptr->march_floor;
424 TheOrder = mptr->march_order;
426 else if ((mptr->march_floor < TheFloor)
427 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
428 strcpy(TheRoom, mptr->march_name);
429 TheFloor = mptr->march_floor;
430 TheOrder = mptr->march_order;
432 else if ((mptr->march_order < TheOrder)
433 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
434 strcpy(TheRoom, mptr->march_name);
435 TheFloor = mptr->march_floor;
436 TheOrder = mptr->march_order;
444 /* Goto next room having unread messages.
445 * We want to skip over rooms that the user has already been to, and take the
446 * user back to the lobby when done. The room we end up in is placed in
447 * newroom - which is set to 0 (the lobby) initially.
448 * We start the search in the current room rather than the beginning to prevent
449 * two or more concurrent users from dragging each other back to the same room.
451 void gotonext(void) {
453 struct march *mptr,*mptr2;
456 /* First check to see if the march-mode list is already allocated.
457 * If it is, pop the first room off the list and go there.
464 while (serv_gets(buf), strcmp(buf,"000")) {
465 mptr = (struct march *) malloc(sizeof(struct march));
467 extract(mptr->march_name,buf,0);
468 mptr->march_floor = extract_int(buf, 2);
469 mptr->march_order = extract_int(buf, 3);
475 while (mptr2->next != NULL)
481 /* add _BASEROOM_ to the end of the march list, so the user will end up
482 * in the system base room (usually the Lobby>) at the end of the loop
484 mptr = (struct march *) malloc(sizeof(struct march));
486 strcpy(mptr->march_name,"_BASEROOM_");
492 while (mptr2->next != NULL)
497 * ...and remove the room we're currently in, so a <G>oto doesn't make us
498 * walk around in circles
500 remove_march(wc_roomname);
505 strcpy(next_room, pop_march(-1));
508 strcpy(next_room,"_BASEROOM_");
510 gotoroom(next_room,1);
516 * mark all messages in current room as having been read
518 void slrp_highest(void) {
522 serv_puts("SLRP HIGHEST");
525 wprintf("<EM>%s</EM><BR>\n",&buf[4]);
532 * un-goto the previous room
537 if (!strcmp(ugname, "")) {
538 gotoroom(wc_roomname, 1);
541 serv_printf("GOTO %s", ugname);
544 gotoroom(wc_roomname, 1);
548 serv_printf("SLRP %ld",uglsn);
557 * display the form for editing a room
559 void display_editroom(void) {
562 char er_password[10];
564 char er_roomaide[26];
573 display_error(&buf[4]);
577 extract(er_name,&buf[4],0);
578 extract(er_password,&buf[4],1);
579 extract(er_dirname,&buf[4],2);
580 er_flags=extract_int(&buf[4],3);
581 er_floor=extract_int(&buf[4],4);
584 printf("HTTP/1.0 200 OK\n");
587 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
588 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
589 wprintf("<B>Edit this room</B>\n");
590 wprintf("</FONT></TD></TR></TABLE>\n");
592 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
594 wprintf("<UL><LI>Name of room: ");
595 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",er_name);
597 wprintf("<LI>Resides on floor: ");
599 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
600 for (i=0; i<128; ++i) if (strlen(floorlist[i])>0) {
602 if (i == er_floor) wprintf("SELECTED ");
603 wprintf("VALUE=\"%d\">", i);
604 escputs(floorlist[i]);
605 wprintf("</OPTION>\n");
607 wprintf("</SELECT>\n");
609 wprintf("<LI>Type of room:<UL>\n");
611 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
612 if ((er_flags & QR_PRIVATE) == 0) wprintf("CHECKED ");
613 wprintf("> Public room\n");
615 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
616 if ((er_flags & QR_PRIVATE)&&
617 (er_flags & QR_GUESSNAME)) wprintf("CHECKED ");
618 wprintf("> Private - guess name\n");
620 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
621 if ((er_flags & QR_PRIVATE)&&
622 (er_flags & QR_PASSWORDED)) wprintf("CHECKED ");
623 wprintf("> Private - require password:\n");
624 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n",er_password);
626 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
627 if ( (er_flags & QR_PRIVATE)
628 && ((er_flags & QR_GUESSNAME) == 0)
629 && ((er_flags & QR_PASSWORDED) == 0) )
631 wprintf("> Private - invitation only\n");
633 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
634 wprintf("> If private, cause current users to forget room\n");
638 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
639 if (er_flags & QR_PREFONLY) wprintf("CHECKED ");
640 wprintf("> Preferred users only\n");
642 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
643 if (er_flags & QR_READONLY) wprintf("CHECKED ");
644 wprintf("> Read-only room\n");
646 /* directory stuff */
647 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
648 if (er_flags & QR_DIRECTORY) wprintf("CHECKED ");
649 wprintf("> File directory room\n");
651 wprintf("<UL><LI>Directory name: ");
652 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n",er_dirname);
654 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
655 if (er_flags & QR_UPLOAD) wprintf("CHECKED ");
656 wprintf("> Uploading allowed\n");
658 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
659 if (er_flags & QR_DOWNLOAD) wprintf("CHECKED ");
660 wprintf("> Downloading allowed\n");
662 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
663 if (er_flags & QR_VISDIR) wprintf("CHECKED ");
664 wprintf("> Visible directory</UL>\n");
666 /* end of directory stuff */
668 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
669 if (er_flags & QR_NETWORK) wprintf("CHECKED ");
670 wprintf("> Network shared room\n");
672 /* start of anon options */
674 wprintf("<LI>Anonymous messages<UL>\n");
676 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
677 if ( ((er_flags & QR_ANONONLY)==0)
678 && ((er_flags & QR_ANONOPT)==0)) wprintf("CHECKED ");
679 wprintf("> No anonymous messages\n");
681 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
682 if (er_flags & QR_ANONONLY) wprintf("CHECKED ");
683 wprintf("> All messages are anonymous\n");
685 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
686 if (er_flags & QR_ANONOPT) wprintf("CHECKED ");
687 wprintf("> Prompt user when entering messages</UL>\n");
689 /* end of anon options */
691 wprintf("<LI>Room aide: \n");
695 wprintf("<EM>%s</EM>\n",&buf[4]);
698 extract(er_roomaide,&buf[4],0);
699 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n",er_roomaide);
702 wprintf("</UL><CENTER>\n");
703 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
704 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
705 wprintf("</CENTER>\n");
707 wprintf("</FORM></HTML>\n");
713 * save new parameters for a room
715 void editroom(void) {
718 char er_password[10];
720 char er_roomaide[26];
726 if (strcmp(bstr("sc"),"OK")) {
727 display_error("Cancelled. Changes were not saved.");
735 display_error(&buf[4]);
739 extract(er_name,&buf[4],0);
740 extract(er_password,&buf[4],1);
741 extract(er_dirname,&buf[4],2);
742 er_flags=extract_int(&buf[4],3);
744 strcpy(er_roomaide,bstr("er_roomaide"));
745 if (strlen(er_roomaide)==0) {
749 strcpy(er_roomaide,"");
752 extract(er_roomaide,&buf[4],0);
756 strcpy(buf,bstr("er_name")); buf[20] = 0;
757 if (strlen(buf)>0) strcpy(er_name,buf);
759 strcpy(buf,bstr("er_password")); buf[10] = 0;
760 if (strlen(buf)>0) strcpy(er_password,buf);
762 strcpy(buf,bstr("er_dirname")); buf[15] = 0;
763 if (strlen(buf)>0) strcpy(er_dirname,buf);
765 strcpy(buf,bstr("type"));
766 er_flags &= !(QR_PRIVATE|QR_PASSWORDED|QR_GUESSNAME);
768 if (!strcmp(buf,"invonly")) {
769 er_flags |= (QR_PRIVATE);
771 if (!strcmp(buf,"guessname")) {
772 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
774 if (!strcmp(buf,"passworded")) {
775 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
778 if (!strcmp(bstr("prefonly"),"yes")) {
779 er_flags |= QR_PREFONLY;
782 er_flags &= ~QR_PREFONLY;
785 if (!strcmp(bstr("readonly"),"yes")) {
786 er_flags |= QR_READONLY;
789 er_flags &= ~QR_READONLY;
792 if (!strcmp(bstr("network"),"yes")) {
793 er_flags |= QR_NETWORK;
796 er_flags &= ~QR_NETWORK;
799 if (!strcmp(bstr("directory"),"yes")) {
800 er_flags |= QR_DIRECTORY;
803 er_flags &= ~QR_DIRECTORY;
806 if (!strcmp(bstr("ulallowed"),"yes")) {
807 er_flags |= QR_UPLOAD;
810 er_flags &= ~QR_UPLOAD;
813 if (!strcmp(bstr("dlallowed"),"yes")) {
814 er_flags |= QR_DOWNLOAD;
817 er_flags &= ~QR_DOWNLOAD;
820 if (!strcmp(bstr("visdir"),"yes")) {
821 er_flags |= QR_VISDIR;
824 er_flags &= ~QR_VISDIR;
827 strcpy(buf,bstr("anon"));
829 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
830 if (!strcmp(buf,"anononly")) er_flags |= QR_ANONONLY;
831 if (!strcmp(buf,"anon2")) er_flags |= QR_ANONOPT;
834 if (!strcmp(bstr("bump"),"yes")) bump = 1;
836 er_floor = atoi(bstr("er_floor"));
838 sprintf(buf,"SETR %s|%s|%s|%u|%d|%d",
839 er_name,er_password,er_dirname,er_flags,bump,er_floor);
843 display_error(&buf[4]);
846 gotoroom(er_name, 0);
848 if (strlen(er_roomaide)>0) {
849 sprintf(buf,"SETA %s",er_roomaide);
853 display_error(&buf[4]);
858 gotoroom(er_name, 1);
864 * display the form for entering a new room
866 void display_entroom(void) {
873 display_error(&buf[4]);
877 printf("HTTP/1.0 200 OK\n");
880 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
881 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
882 wprintf("<B>Enter (create) a new room</B>\n");
883 wprintf("</FONT></TD></TR></TABLE>\n");
885 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
887 wprintf("<UL><LI>Name of room: ");
888 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
890 wprintf("<LI>Type of room:<UL>\n");
892 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
893 wprintf("CHECKED > Public room\n");
895 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
896 wprintf("> Private - guess name\n");
898 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
899 wprintf("> Private - require password:\n");
900 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
902 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
903 wprintf("> Private - invitation only\n");
905 wprintf("<CENTER>\n");
906 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
907 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
908 wprintf("</CENTER>\n");
909 wprintf("</FORM></HTML>\n");
922 char er_password[10];
925 if (strcmp(bstr("sc"),"OK")) {
926 display_error("Cancelled. No new room was created.");
930 strcpy(er_name,bstr("er_name"));
931 strcpy(er_type,bstr("type"));
932 strcpy(er_password,bstr("er_password"));
935 if (!strcmp(er_type,"guessname")) er_num_type = 1;
936 if (!strcmp(er_type,"passworded")) er_num_type = 2;
937 if (!strcmp(er_type,"invonly")) er_num_type = 3;
939 sprintf(buf,"CRE8 1|%s|%d|%s",er_name,er_num_type,er_password);
943 display_error(&buf[4]);
946 gotoroom(er_name, 1);
951 * display the screen to enter a private room
953 void display_private(char *rname, int req_pass)
956 printf("HTTP/1.0 200 OK\n");
959 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
960 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
961 wprintf("<B>Goto a private room</B>\n");
962 wprintf("</FONT></TD></TR></TABLE>\n");
964 wprintf("<CENTER>\n");
965 wprintf("If you know the name of a hidden (guess-name) or\n");
966 wprintf("passworded room, you can enter that room by typing\n");
967 wprintf("its name below. Once you gain access to a private\n");
968 wprintf("room, it will appear in your regular room listings\n");
969 wprintf("so you don't have to keep returning here.\n");
972 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
974 wprintf("<TABLE border><TR><TD>");
975 wprintf("Enter room name:</TD><TD>");
976 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",rname);
979 wprintf("</TD></TR><TR><TD>");
980 wprintf("Enter room password:</TD><TD>");
981 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
984 wprintf("</TD></TR></TABLE>\n");
986 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
987 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
988 wprintf("</FORM></HTML>\n");
993 * goto a private room
995 void goto_private(void) {
999 if (strcasecmp(bstr("sc"),"OK")) {
1000 display_main_menu();
1004 strcpy(hold_rm,wc_roomname);
1005 strcpy(buf,"GOTO ");
1006 strcat(buf,bstr("gr_name"));
1008 strcat(buf,bstr("gr_pass"));
1013 gotoroom(bstr("gr_name"),1);
1017 if (!strncmp(buf,"540",3)) {
1018 display_private(bstr("gr_name"),1);
1022 printf("HTTP/1.0 200 OK\n");
1024 wprintf("%s\n",&buf[4]);
1031 * display the screen to zap a room
1033 void display_zap(void) {
1034 printf("HTTP/1.0 200 OK\n");
1037 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1038 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1039 wprintf("<B>Zap (forget) the current room</B>\n");
1040 wprintf("</FONT></TD></TR></TABLE>\n");
1042 wprintf("If you select this option, <em>%s</em> will ", wc_roomname);
1043 wprintf("disappear from your room list. Is this what you wish ");
1044 wprintf("to do?<BR>\n");
1046 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1047 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1048 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1049 wprintf("</FORM></HTML>\n");
1060 if (strcmp(bstr("sc"),"OK")) {
1061 display_main_menu();
1065 serv_printf("GOTO %s", wc_roomname);
1067 if (buf[0] != '2') {
1068 display_error(&buf[4]);
1074 if (buf[0] != '2') {
1075 display_error(&buf[4]);
1079 gotoroom(bstr("_BASEROOM_"),1);
1086 * Confirm deletion of the current room
1088 void confirm_delete_room(void) {
1091 serv_puts("KILL 0");
1093 if (buf[0] != '2') {
1094 display_error(&buf[4]);
1098 printf("HTTP/1.0 200 OK\n");
1100 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1101 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1102 wprintf("<B>Confirm deletion of room</B>\n");
1103 wprintf("</FONT></TD></TR></TABLE>\n");
1105 wprintf("<CENTER>");
1106 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1108 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1109 escputs(wc_roomname);
1110 wprintf("</FONT>?<BR>\n");
1112 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1113 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1115 wprintf("</FORM></CENTER></BODY></HTML>\n");
1121 * Delete the current room
1123 void delete_room(void) {
1127 strcpy(sc, bstr("sc"));
1129 if (strcasecmp(sc, "Delete")) {
1130 display_error("Cancelled. This room was not deleted.");
1134 serv_puts("KILL 1");
1136 if (buf[0] != '2') {
1137 display_error(&buf[4]);
1140 gotoroom("_BASEROOM_", 1);