10 #include <sys/types.h>
12 #include <sys/socket.h>
15 #include <netinet/in.h>
34 char floorlist[128][SIZ];
37 * load the list of floors
39 void load_floorlist(void)
44 for (a = 0; a < 128; ++a)
50 strcpy(floorlist[0], "Main Floor");
53 while (serv_gets(buf), strcmp(buf, "000")) {
54 extract(floorlist[extract_int(buf, 0)], buf, 1);
60 * remove a room from the march list
62 void remove_march(char *aaa)
64 struct march *mptr, *mptr2;
66 if (WC->march == NULL)
69 if (!strcasecmp(WC->march->march_name, aaa)) {
70 mptr = WC->march->next;
76 for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
77 if (!strcasecmp(mptr->march_name, aaa)) {
78 mptr2->next = mptr->next;
91 void room_tree_list(struct roomlisting *rp)
99 if (rp->lnext != NULL) {
100 room_tree_list(rp->lnext);
102 strcpy(rmname, rp->rlname);
105 wprintf("<A HREF=\"/dotgoto&room=");
110 if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
112 else if (f & QR_DIRECTORY)
114 else if (f & QR_NETWORK)
118 wprintf("</A><TT> </TT>\n");
120 if (rp->rnext != NULL) {
121 room_tree_list(rp->rnext);
128 * Room ordering stuff (compare first by floor, then by order)
130 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
132 if ((r1 == NULL) && (r2 == NULL))
138 if (r1->rlfloor < r2->rlfloor)
140 if (r1->rlfloor > r2->rlfloor)
142 if (r1->rlorder < r2->rlorder)
144 if (r1->rlorder > r2->rlorder)
151 * Common code for all room listings
153 void listrms(char *variety)
158 struct roomlisting *rl = NULL;
159 struct roomlisting *rp;
160 struct roomlisting *rs;
163 /* Ask the server for a room list */
170 while (serv_gets(buf), strcmp(buf, "000")) {
172 rp = malloc(sizeof(struct roomlisting));
173 extract(rp->rlname, buf, 0);
174 rp->rlflags = extract_int(buf, 1);
175 rp->rlfloor = extract_int(buf, 2);
176 rp->rlorder = extract_int(buf, 3);
185 if (rordercmp(rp, rs) < 0) {
186 if (rs->lnext == NULL) {
193 if (rs->rnext == NULL) {
205 /* If no rooms were listed, print an nbsp to make the cell
206 * borders show up anyway.
208 if (num_rooms == 0) wprintf(" ");
220 * list all rooms by floor (only should get called from knrooms() because
221 * that's where output_headers() is called from)
223 void list_all_rooms_by_floor(void)
228 wprintf("<TABLE width=100%% border><TR><TH>Floor</TH>");
229 wprintf("<TH>Rooms with new messages</TH>");
230 wprintf("<TH>Rooms with no new messages</TH></TR>\n");
232 for (a = 0; a < 128; ++a)
233 if (floorlist[a][0] != 0) {
235 /* Floor name column */
238 serv_printf("OIMG _floorpic_|%d", a);
243 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
244 a, &floorlist[a][0]);
246 escputs(&floorlist[a][0]);
251 /* Rooms with new messages column */
253 sprintf(buf, "LKRN %d", a);
255 wprintf("</TD>\n<TD>");
257 /* Rooms with old messages column */
258 sprintf(buf, "LKRO %d", a);
260 wprintf("</TD></TR>\n");
262 wprintf("</TABLE>\n");
268 * list all forgotten rooms
270 void zapped_list(void)
273 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
274 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
275 wprintf("<B>Zapped (forgotten) rooms</B>\n");
276 wprintf("</TD></TR></TABLE><BR>\n");
278 wprintf("<BR><BR>\n");
279 wprintf("Click on any room to un-zap it and goto that room.\n");
285 * read this room's info file (set v to 1 for verbose mode)
301 /* Display room graphic. The server doesn't actually
302 * need the room name, but we supply it in order to
303 * keep the browser from using a cached graphic from
306 void embed_room_graphic(void) {
309 serv_puts("OIMG _roompic_");
312 wprintf("<TD BGCOLOR=444455>");
313 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
314 urlescputs(WC->wc_roomname);
323 /* Let the user know if new mail has arrived
325 void embed_newmail_button(void) {
326 if ( (WC->new_mail > WC->remember_new_mail) && (WC->new_mail>0) ) {
328 "<A HREF=\"/dotgoto?room=_MAIL_\">"
329 "<IMG SRC=\"/static/mail.gif\" border=0 "
330 "ALT=\"You have new mail\">"
331 "<BR><FONT SIZE=2 COLOR=FFFFFF>"
332 "%d new mail</FONT></A>", WC->new_mail);
333 WC->remember_new_mail = WC->new_mail;
340 * Display the current view and offer an option to change it
342 void embed_view_o_matic(void) {
345 wprintf("<FORM NAME=\"viewomatic\">\n"
346 "<SELECT NAME=\"newview\" SIZE=\"1\" "
347 "OnChange=\"location.href=viewomatic.newview.options"
348 "[selectedIndex].value\">\n");
350 for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) {
351 wprintf("<OPTION %s VALUE=\"/changeview?view=%d\">",
352 ((i == WC->wc_view) ? "SELECTED" : ""),
354 escputs(viewdefs[i]);
355 wprintf("</OPTION>\n");
357 wprintf("</SELECT></FORM>\n");
362 void embed_room_banner(char *got) {
365 /* We need to have the information returned by a GOTO server command.
366 * If it isn't supplied, we fake it by issuing our own GOTO.
369 serv_printf("GOTO %s", WC->wc_roomname);
374 /* If the user happens to select the "make this my start page" link,
375 * we want it to remember the URL as a "/dotskip" one instead of
376 * a "skip" or "gotonext" or something like that.
378 snprintf(WC->this_page, sizeof(WC->this_page), "/dotskip&room=%s",
381 /* Check for new mail. */
382 WC->new_mail = extract_int(&got[4], 9);
383 WC->wc_view = extract_int(&got[4], 11);
385 svprintf("ROOMNAME", WCS_STRING, "%s", WC->wc_roomname);
386 svprintf("NEWMSGS", WCS_STRING, "%d", extract_int(&got[4], 1));
387 svprintf("TOTALMSGS", WCS_STRING, "%d", extract_int(&got[4], 2));
388 svcallback("ROOMPIC", embed_room_graphic);
389 svcallback("ROOMINFO", readinfo);
390 svcallback("YOUHAVEMAIL", embed_newmail_button);
391 svcallback("VIEWOMATIC", embed_view_o_matic);
392 svcallback("START", offer_start_page);
394 do_template("roombanner");
395 clear_local_substs();
403 * generic routine to take the session to a new room
405 * display_name values: 0 = goto only
406 * 1 = goto and display
409 void gotoroom(char *gname, int display_name)
412 static long ls = (-1L);
417 wprintf("Pragma: no-cache\n");
418 wprintf("Cache-Control: no-store\n");
420 wprintf("<HTML><HEAD>\n"
421 "<META HTTP-EQUIV=\"refresh\" CONTENT=\"500363689;\">\n"
422 "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
423 "<META HTTP-EQUIV=\"expired\" CONTENT=\"28-May-1971 18:10:00 GMT\">\n"
424 "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\">\n"
426 do_template("background");
428 if (display_name != 2) {
429 /* store ungoto information */
430 strcpy(WC->ugname, WC->wc_roomname);
433 /* move to the new room */
434 serv_printf("GOTO %s", gname);
437 serv_puts("GOTO _BASEROOM_");
442 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
447 extract(WC->wc_roomname, &buf[4], 0);
448 WC->room_flags = extract_int(&buf[4], 4);
449 /* highest_msg_read = extract_int(&buf[4],6);
450 maxmsgnum = extract_int(&buf[4],5);
451 is_mail = (char) extract_int(&buf[4],7); */
452 ls = extract_long(&buf[4], 6);
455 WC->is_room_aide = WC->is_aide;
457 WC->is_room_aide = (char) extract_int(&buf[4], 8);
459 remove_march(WC->wc_roomname);
460 if (!strcasecmp(gname, "_BASEROOM_"))
463 /* Display the room banner */
465 embed_room_banner(buf);
468 strcpy(WC->wc_roomname, WC->wc_roomname);
469 WC->wc_view = extract_int(&buf[4], 11);
474 * Locate the room on the march list which we most want to go to. Each room
475 * is measured given a "weight" of preference based on various factors.
477 char *pop_march(int desired_floor)
479 static char TheRoom[128];
481 int TheOrder = 32767;
484 struct march *mptr = NULL;
486 strcpy(TheRoom, "_BASEROOM_");
487 if (WC->march == NULL)
490 for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
492 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
493 weight = weight + 10000;
494 if (mptr->march_floor == desired_floor)
495 weight = weight + 5000;
497 weight = weight + ((128 - (mptr->march_floor)) * 128);
498 weight = weight + (128 - (mptr->march_order));
500 if (weight > TheWeight) {
502 strcpy(TheRoom, mptr->march_name);
503 TheFloor = mptr->march_floor;
504 TheOrder = mptr->march_order;
512 /* Goto next room having unread messages.
513 * We want to skip over rooms that the user has already been to, and take the
514 * user back to the lobby when done. The room we end up in is placed in
515 * newroom - which is set to 0 (the lobby) initially.
516 * We start the search in the current room rather than the beginning to prevent
517 * two or more concurrent users from dragging each other back to the same room.
522 struct march *mptr, *mptr2;
525 /* First check to see if the march-mode list is already allocated.
526 * If it is, pop the first room off the list and go there.
529 if (WC->march == NULL) {
533 while (serv_gets(buf), strcmp(buf, "000")) {
534 mptr = (struct march *) malloc(sizeof(struct march));
536 extract(mptr->march_name, buf, 0);
537 mptr->march_floor = extract_int(buf, 2);
538 mptr->march_order = extract_int(buf, 3);
539 if (WC->march == NULL) {
543 while (mptr2->next != NULL)
548 /* add _BASEROOM_ to the end of the march list, so the user will end up
549 * in the system base room (usually the Lobby>) at the end of the loop
551 mptr = (struct march *) malloc(sizeof(struct march));
553 strcpy(mptr->march_name, "_BASEROOM_");
554 if (WC->march == NULL) {
558 while (mptr2->next != NULL)
563 * ...and remove the room we're currently in, so a <G>oto doesn't make us
564 * walk around in circles
566 remove_march(WC->wc_roomname);
568 if (WC->march != NULL) {
569 strcpy(next_room, pop_march(-1));
571 strcpy(next_room, "_BASEROOM_");
575 smart_goto(next_room);
579 void smart_goto(char *next_room) {
580 gotoroom(next_room, 0);
587 * mark all messages in current room as having been read
589 void slrp_highest(void)
594 serv_puts("SLRP HIGHEST");
597 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
604 * un-goto the previous room
610 if (!strcmp(WC->ugname, "")) {
611 smart_goto(WC->wc_roomname);
614 serv_printf("GOTO %s", WC->ugname);
617 smart_goto(WC->wc_roomname);
620 if (WC->uglsn >= 0L) {
621 serv_printf("SLRP %ld", WC->uglsn);
624 strcpy(buf, WC->ugname);
625 strcpy(WC->ugname, "");
634 * Set/clear/read the "self-service list subscribe" flag for a room
636 * Set 'newval' to 0 to clear, 1 to set, any other value to leave unchanged.
637 * Always returns the new value.
640 int self_service(int newval) {
641 int current_value = 0;
647 int flags, floor, order, view, flags2;
651 if (buf[0] != '2') return(0);
653 extract(name, &buf[4], 0);
654 extract(password, &buf[4], 1);
655 extract(dirname, &buf[4], 2);
656 flags = extract_int(&buf[4], 3);
657 floor = extract_int(&buf[4], 4);
658 order = extract_int(&buf[4], 5);
659 view = extract_int(&buf[4], 6);
660 flags2 = extract_int(&buf[4], 7);
662 if (flags2 & QR2_SELFLIST) {
670 flags2 = flags2 | QR2_SELFLIST;
672 else if (newval == 0) {
673 flags2 = flags2 & ~QR2_SELFLIST;
676 return(current_value);
679 if (newval != current_value) {
680 serv_printf("SETR %s|%s|%s|%d|0|%d|%d|%d|%d",
681 name, password, dirname, flags,
682 floor, order, view, flags2);
696 * display the form for editing a room
698 void display_editroom(void)
705 char er_password[10];
707 char er_roomaide[26];
713 char *not_shared_with;
716 if (strlen(tab) == 0) tab = "admin";
722 display_error(&buf[4]);
725 extract(er_name, &buf[4], 0);
726 extract(er_password, &buf[4], 1);
727 extract(er_dirname, &buf[4], 2);
728 er_flags = extract_int(&buf[4], 3);
729 er_floor = extract_int(&buf[4], 4);
733 /* print the tabbed dialog */
734 wprintf("<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
735 "<TR ALIGN=CENTER BGCOLOR=FFFFFF>"
736 "<TD> </TD>\n");
738 if (!strcmp(tab, "admin")) {
739 wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
742 wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=admin\">");
744 wprintf("Room administration");
745 if (!strcmp(tab, "admin")) {
746 wprintf("</B></FONT></TD>\n");
749 wprintf("</A></TD>\n");
752 wprintf("<TD> </TD>\n");
754 if (!strcmp(tab, "config")) {
755 wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
758 wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=config\">");
760 wprintf("Room configuration");
761 if (!strcmp(tab, "config")) {
762 wprintf("</B></FONT></TD>\n");
765 wprintf("</A></TD>\n");
768 wprintf("<TD> </TD>\n");
770 if (!strcmp(tab, "sharing")) {
771 wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
774 wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=sharing\">");
777 if (!strcmp(tab, "sharing")) {
778 wprintf("</B></FONT></TD>\n");
781 wprintf("</A></TD>\n");
784 wprintf("<TD> </TD>\n");
786 if (!strcmp(tab, "listserv")) {
787 wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
790 wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=listserv\">");
792 wprintf("Mailing list service");
793 if (!strcmp(tab, "listserv")) {
794 wprintf("</B></FONT></TD>\n");
797 wprintf("</A></TD>\n");
800 wprintf("<TD> </TD></TR>"
801 "<TR><TD BGCOLOR=000077 COLSPAN=9 HEIGHT=5> </TD></TR>"
804 /* end tabbed dialog */
807 if (!strcmp(tab, "admin")) {
809 "<LI><A HREF=\"/confirm_delete_room\">\n"
810 "Delete this room</A>\n"
811 "<LI><A HREF=\"/display_editroompic\">\n"
812 "Set or change the graphic for this room's banner</A>\n"
813 "<LI><A HREF=\"/display_editinfo\">\n"
814 "Edit this room's Info file</A>\n"
818 if (!strcmp(tab, "config")) {
819 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
821 wprintf("<UL><LI>Name of room: ");
822 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
824 wprintf("<LI>Resides on floor: ");
826 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
827 for (i = 0; i < 128; ++i)
828 if (strlen(floorlist[i]) > 0) {
831 wprintf("SELECTED ");
832 wprintf("VALUE=\"%d\">", i);
833 escputs(floorlist[i]);
834 wprintf("</OPTION>\n");
836 wprintf("</SELECT>\n");
838 wprintf("<LI>Type of room:<UL>\n");
840 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
841 if ((er_flags & QR_PRIVATE) == 0)
843 wprintf("> Public room\n");
845 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
846 if ((er_flags & QR_PRIVATE) &&
847 (er_flags & QR_GUESSNAME))
849 wprintf("> Private - guess name\n");
851 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
852 if ((er_flags & QR_PRIVATE) &&
853 (er_flags & QR_PASSWORDED))
855 wprintf("> Private - require password:\n");
856 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
858 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
859 if ((er_flags & QR_PRIVATE)
860 && ((er_flags & QR_GUESSNAME) == 0)
861 && ((er_flags & QR_PASSWORDED) == 0))
863 wprintf("> Private - invitation only\n");
865 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
866 wprintf("> If private, cause current users to forget room\n");
870 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
871 if (er_flags & QR_PREFONLY)
873 wprintf("> Preferred users only\n");
875 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
876 if (er_flags & QR_READONLY)
878 wprintf("> Read-only room\n");
880 /* directory stuff */
881 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
882 if (er_flags & QR_DIRECTORY)
884 wprintf("> File directory room\n");
886 wprintf("<UL><LI>Directory name: ");
887 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
889 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
890 if (er_flags & QR_UPLOAD)
892 wprintf("> Uploading allowed\n");
894 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
895 if (er_flags & QR_DOWNLOAD)
897 wprintf("> Downloading allowed\n");
899 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
900 if (er_flags & QR_VISDIR)
902 wprintf("> Visible directory</UL>\n");
904 /* end of directory stuff */
906 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
907 if (er_flags & QR_NETWORK)
909 wprintf("> Network shared room\n");
911 /* start of anon options */
913 wprintf("<LI>Anonymous messages<UL>\n");
915 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
916 if (((er_flags & QR_ANONONLY) == 0)
917 && ((er_flags & QR_ANONOPT) == 0))
919 wprintf("> No anonymous messages\n");
921 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
922 if (er_flags & QR_ANONONLY)
924 wprintf("> All messages are anonymous\n");
926 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
927 if (er_flags & QR_ANONOPT)
929 wprintf("> Prompt user when entering messages</UL>\n");
931 /* end of anon options */
933 wprintf("<LI>Room aide: \n");
937 wprintf("<EM>%s</EM>\n", &buf[4]);
939 extract(er_roomaide, &buf[4], 0);
940 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
943 wprintf("</UL><CENTER>\n");
944 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
945 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
946 wprintf("</CENTER>\n");
950 /* Sharing the room with other Citadel nodes... */
951 if (!strcmp(tab, "sharing")) {
953 shared_with = strdup("");
954 not_shared_with = strdup("");
956 /* Learn the current configuration */
957 serv_puts("CONF getsys|application/x-citadel-ignet-config");
959 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
960 extract(node, buf, 0);
961 not_shared_with = realloc(not_shared_with,
962 strlen(not_shared_with) + 32);
963 strcat(not_shared_with, node);
964 strcat(not_shared_with, "|");
969 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
970 extract(cmd, buf, 0);
971 extract(node, buf, 1);
972 if (!strcasecmp(cmd, "ignet_push_share")) {
973 shared_with = realloc(shared_with,
974 strlen(shared_with) + 32);
975 strcat(shared_with, node);
976 strcat(shared_with, "|");
980 for (i=0; i<num_tokens(shared_with, '|'); ++i) {
981 extract(node, shared_with, i);
982 for (j=0; j<num_tokens(not_shared_with, '|'); ++j) {
983 extract(cmd, not_shared_with, j);
984 if (!strcasecmp(node, cmd)) {
985 remove_token(not_shared_with, j, '|');
990 /* Display the stuff */
991 wprintf("<CENTER><BR>"
992 "<TABLE border=1 cellpadding=5><TR>"
993 "<TD><B><I>Shared with</I></B></TD>"
994 "<TD><B><I>Not shared with</I></B></TD></TR>\n"
997 for (i=0; i<num_tokens(shared_with, '|'); ++i) {
998 extract(node, shared_with, i);
999 if (strlen(node) > 0) {
1000 wprintf("%s ", node);
1001 wprintf("<A HREF=\"/netedit&cmd=remove&line="
1002 "ignet_push_share|");
1004 wprintf("&tab=sharing\">(unshare)</A><BR>");
1008 wprintf("</TD><TD>\n");
1010 for (i=0; i<num_tokens(not_shared_with, '|'); ++i) {
1011 extract(node, not_shared_with, i);
1012 if (strlen(node) > 0) {
1013 wprintf("%s ", node);
1014 wprintf("<A HREF=\"/netedit&cmd=add&line="
1015 "ignet_push_share|");
1017 wprintf("&tab=sharing\">(share)</A><BR>");
1021 wprintf("</TD></TR>"
1023 "<I><B>Reminder:</B> When sharing a room, "
1024 "it must be shared from both ends. Adding a node to "
1025 "the 'shared' list sends messages out, but in order to"
1026 " receive messages, the other nodes must be configured"
1027 " to send messages out to your system as well.</I><BR>"
1032 /* Mailing list management */
1033 if (!strcmp(tab, "listserv")) {
1035 wprintf("<BR><center>"
1036 "<TABLE BORDER=0 WIDTH=100%% CELLPADDING=5>"
1037 "<TR><TD VALIGN=TOP>");
1039 wprintf("<i>The contents of this room are being "
1040 "mailed <b>as individual messages</b> "
1041 "to the following list recipients:"
1046 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
1047 extract(cmd, buf, 0);
1048 if (!strcasecmp(cmd, "listrecp")) {
1049 extract(recp, buf, 1);
1052 wprintf(" <A HREF=\"/netedit&cmd=remove&line="
1055 wprintf("&tab=listserv\">(remove)</A><BR>");
1059 wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/netedit\">\n"
1060 "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
1061 "<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"listrecp|\">\n");
1062 wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
1063 wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
1064 wprintf("</FORM>\n");
1066 wprintf("</TD><TD VALIGN=TOP>\n");
1068 wprintf("<i>The contents of this room are being "
1069 "mailed <b>in digest form</b> "
1070 "to the following list recipients:"
1075 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
1076 extract(cmd, buf, 0);
1077 if (!strcasecmp(cmd, "digestrecp")) {
1078 extract(recp, buf, 1);
1081 wprintf(" <A HREF=\"/netedit&cmd=remove&line="
1084 wprintf("&tab=listserv\">(remove)</A><BR>");
1088 wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/netedit\">\n"
1089 "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
1090 "<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"digestrecp|\">\n");
1091 wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
1092 wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
1093 wprintf("</FORM>\n");
1095 wprintf("</TD></TR></TABLE><HR>\n");
1097 if (self_service(999) == 1) {
1098 wprintf("This room is configured to allow "
1099 "self-service subscribe/unsubscribe requests."
1100 " <A HREF=\"/toggle_self_service?newval=0&"
1102 "Click to disable.</A><BR>\n"
1103 "The URL for subscribe/unsubscribe is: "
1104 "<TT>http://%s/listsub</TT><BR>\n",
1109 wprintf("This room is <i>not</i> configured to allow "
1110 "self-service subscribe/unsubscribe requests."
1111 " <A HREF=\"/toggle_self_service?newval=1&"
1113 "Click to enable.</A><BR>\n"
1118 wprintf("</CENTER>\n");
1126 * Toggle self-service list subscription
1128 void toggle_self_service(void) {
1131 newval = atoi(bstr("newval"));
1132 self_service(newval);
1139 * save new parameters for a room
1145 char er_password[10];
1146 char er_dirname[15];
1147 char er_roomaide[26];
1153 if (strcmp(bstr("sc"), "OK")) {
1154 display_error("Cancelled. Changes were not saved.");
1160 if (buf[0] != '2') {
1161 display_error(&buf[4]);
1164 extract(er_name, &buf[4], 0);
1165 extract(er_password, &buf[4], 1);
1166 extract(er_dirname, &buf[4], 2);
1167 er_flags = extract_int(&buf[4], 3);
1169 strcpy(er_roomaide, bstr("er_roomaide"));
1170 if (strlen(er_roomaide) == 0) {
1173 if (buf[0] != '2') {
1174 strcpy(er_roomaide, "");
1176 extract(er_roomaide, &buf[4], 0);
1179 strcpy(buf, bstr("er_name"));
1181 if (strlen(buf) > 0)
1182 strcpy(er_name, buf);
1184 strcpy(buf, bstr("er_password"));
1186 if (strlen(buf) > 0)
1187 strcpy(er_password, buf);
1189 strcpy(buf, bstr("er_dirname"));
1191 if (strlen(buf) > 0)
1192 strcpy(er_dirname, buf);
1194 strcpy(buf, bstr("type"));
1195 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
1197 if (!strcmp(buf, "invonly")) {
1198 er_flags |= (QR_PRIVATE);
1200 if (!strcmp(buf, "guessname")) {
1201 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
1203 if (!strcmp(buf, "passworded")) {
1204 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
1206 if (!strcmp(bstr("prefonly"), "yes")) {
1207 er_flags |= QR_PREFONLY;
1209 er_flags &= ~QR_PREFONLY;
1212 if (!strcmp(bstr("readonly"), "yes")) {
1213 er_flags |= QR_READONLY;
1215 er_flags &= ~QR_READONLY;
1218 if (!strcmp(bstr("network"), "yes")) {
1219 er_flags |= QR_NETWORK;
1221 er_flags &= ~QR_NETWORK;
1224 if (!strcmp(bstr("directory"), "yes")) {
1225 er_flags |= QR_DIRECTORY;
1227 er_flags &= ~QR_DIRECTORY;
1230 if (!strcmp(bstr("ulallowed"), "yes")) {
1231 er_flags |= QR_UPLOAD;
1233 er_flags &= ~QR_UPLOAD;
1236 if (!strcmp(bstr("dlallowed"), "yes")) {
1237 er_flags |= QR_DOWNLOAD;
1239 er_flags &= ~QR_DOWNLOAD;
1242 if (!strcmp(bstr("visdir"), "yes")) {
1243 er_flags |= QR_VISDIR;
1245 er_flags &= ~QR_VISDIR;
1248 strcpy(buf, bstr("anon"));
1250 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
1251 if (!strcmp(buf, "anononly"))
1252 er_flags |= QR_ANONONLY;
1253 if (!strcmp(buf, "anon2"))
1254 er_flags |= QR_ANONOPT;
1257 if (!strcmp(bstr("bump"), "yes"))
1260 er_floor = atoi(bstr("er_floor"));
1262 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
1263 er_name, er_password, er_dirname, er_flags, bump, er_floor);
1266 if (buf[0] != '2') {
1267 display_error(&buf[4]);
1270 gotoroom(er_name, 0);
1272 if (strlen(er_roomaide) > 0) {
1273 sprintf(buf, "SETA %s", er_roomaide);
1276 if (buf[0] != '2') {
1277 display_error(&buf[4]);
1281 smart_goto(er_name);
1285 * Invite, Kick, and show Who Knows a room
1287 void display_whok(void)
1289 char buf[SIZ], room[SIZ], username[SIZ];
1294 if (buf[0] != '2') {
1295 display_error(&buf[4]);
1298 extract(room, &buf[4], 0);
1300 strcpy(username, bstr("username"));
1304 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
1305 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Access control list for ");
1306 escputs(WC->wc_roomname);
1307 wprintf("</B></FONT></TD></TR></TABLE>\n");
1309 if(!strcmp(bstr("sc"), "Kick")) {
1310 sprintf(buf, "KICK %s", username);
1314 if (buf[0] != '2') {
1315 display_error(&buf[4]);
1318 wprintf("<B><I>User %s kicked out of room %s.</I></B>\n",
1321 } else if(!strcmp(bstr("sc"), "Invite")) {
1322 sprintf(buf, "INVT %s", username);
1326 if (buf[0] != '2') {
1327 display_error(&buf[4]);
1330 wprintf("<B><I>User %s invited to room %s.</I></B>\n",
1337 wprintf("<TABLE border=0 CELLSPACING=10><TR VALIGN=TOP>"
1338 "<TD>The users listed below have access to this room. "
1339 "To remove a user from the access list, select the user "
1340 "name from the list and click 'Kick'.<BR><BR>");
1342 wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
1343 wprintf("<SELECT NAME=\"username\" SIZE=10>\n");
1346 if (buf[0] == '1') {
1347 while (serv_gets(buf), strcmp(buf, "000")) {
1348 extract(username, buf, 0);
1349 wprintf("<OPTION>");
1354 wprintf("</SELECT><BR>\n");
1356 wprintf("<input type=submit name=sc value=\"Kick\">");
1357 wprintf("</FORM></CENTER>\n");
1360 "To grant another user access to this room, enter the "
1361 "user name in the box below and click 'Invite'.<BR><BR>");
1363 wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
1364 wprintf("Invite: ");
1365 wprintf("<input type=text name=username><BR>\n"
1366 "<input type=hidden name=sc value=\"Invite\">"
1367 "<input type=submit value=\"Invite\">"
1368 "</FORM></CENTER>\n");
1370 wprintf("</TD></TR></TABLE>\n");
1377 * display the form for entering a new room
1379 void display_entroom(void)
1384 serv_puts("CRE8 0");
1387 if (buf[0] != '2') {
1388 display_error(&buf[4]);
1393 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
1394 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1395 wprintf("<B>Enter (create) a new room</B>\n");
1396 wprintf("</FONT></TD></TR></TABLE>\n");
1398 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
1400 wprintf("<UL><LI>Name of room: ");
1401 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
1403 wprintf("<LI>Type of room:<UL>\n");
1405 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
1406 wprintf("CHECKED > Public room\n");
1408 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
1409 wprintf("> Private - guess name\n");
1411 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
1412 wprintf("> Private - require password:\n");
1413 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
1415 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
1416 wprintf("> Private - invitation only\n");
1419 wprintf("<LI>Resides on floor: ");
1421 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
1422 for (i = 0; i < 128; ++i)
1423 if (strlen(floorlist[i]) > 0) {
1424 wprintf("<OPTION ");
1425 wprintf("VALUE=\"%d\">", i);
1426 escputs(floorlist[i]);
1427 wprintf("</OPTION>\n");
1429 wprintf("</SELECT>\n");
1433 wprintf("<CENTER>\n");
1434 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1435 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1436 wprintf("</CENTER>\n");
1437 wprintf("</FORM>\n<HR>");
1438 serv_printf("MESG roomaccess");
1440 if (buf[0] == '1') {
1456 char er_password[10];
1460 if (strcmp(bstr("sc"), "OK")) {
1461 display_error("Cancelled. No new room was created.");
1464 strcpy(er_name, bstr("er_name"));
1465 strcpy(er_type, bstr("type"));
1466 strcpy(er_password, bstr("er_password"));
1467 er_floor = atoi(bstr("er_floor"));
1470 if (!strcmp(er_type, "guessname"))
1472 if (!strcmp(er_type, "passworded"))
1474 if (!strcmp(er_type, "invonly"))
1477 sprintf(buf, "CRE8 1|%s|%d|%s|%d",
1478 er_name, er_num_type, er_password, er_floor);
1481 if (buf[0] != '2') {
1482 display_error(&buf[4]);
1485 smart_goto(er_name);
1490 * display the screen to enter a private room
1492 void display_private(char *rname, int req_pass)
1497 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
1498 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1499 wprintf("<B>Goto a private room</B>\n");
1500 wprintf("</FONT></TD></TR></TABLE>\n");
1502 wprintf("<CENTER>\n");
1503 wprintf("If you know the name of a hidden (guess-name) or\n");
1504 wprintf("passworded room, you can enter that room by typing\n");
1505 wprintf("its name below. Once you gain access to a private\n");
1506 wprintf("room, it will appear in your regular room listings\n");
1507 wprintf("so you don't have to keep returning here.\n");
1508 wprintf("<BR><BR>");
1510 wprintf("<FORM METHOD=\"GET\" ACTION=\"/goto_private\">\n");
1512 wprintf("<TABLE border><TR><TD>");
1513 wprintf("Enter room name:</TD><TD>");
1514 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1517 wprintf("</TD></TR><TR><TD>");
1518 wprintf("Enter room password:</TD><TD>");
1519 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1521 wprintf("</TD></TR></TABLE>\n");
1523 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1524 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1525 wprintf("</FORM>\n");
1530 * goto a private room
1532 void goto_private(void)
1537 if (strcasecmp(bstr("sc"), "OK")) {
1538 display_main_menu();
1541 strcpy(hold_rm, WC->wc_roomname);
1542 strcpy(buf, "GOTO ");
1543 strcat(buf, bstr("gr_name"));
1545 strcat(buf, bstr("gr_pass"));
1549 if (buf[0] == '2') {
1550 smart_goto(bstr("gr_name"));
1553 if (!strncmp(buf, "540", 3)) {
1554 display_private(bstr("gr_name"), 1);
1558 wprintf("%s\n", &buf[4]);
1565 * display the screen to zap a room
1567 void display_zap(void)
1571 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
1572 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1573 wprintf("<B>Zap (forget) the current room</B>\n");
1574 wprintf("</FONT></TD></TR></TABLE>\n");
1576 wprintf("If you select this option, <em>%s</em> will ", WC->wc_roomname);
1577 wprintf("disappear from your room list. Is this what you wish ");
1578 wprintf("to do?<BR>\n");
1580 wprintf("<FORM METHOD=\"GET\" ACTION=\"/zap\">\n");
1581 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1582 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1583 wprintf("</FORM>\n");
1594 char final_destination[SIZ];
1596 /* If the forget-room routine fails for any reason, we fall back
1597 * to the current room; otherwise, we go to the Lobby
1599 strcpy(final_destination, WC->wc_roomname);
1601 if (!strcasecmp(bstr("sc"), "OK")) {
1602 serv_printf("GOTO %s", WC->wc_roomname);
1604 if (buf[0] != '2') {
1605 /* ExpressMessageCat(&buf[4]); */
1609 if (buf[0] != '2') {
1610 /* ExpressMessageCat(&buf[4]); */
1612 strcpy(final_destination, "_BASEROOM_");
1616 smart_goto(final_destination);
1623 * Confirm deletion of the current room
1625 void confirm_delete_room(void)
1629 serv_puts("KILL 0");
1631 if (buf[0] != '2') {
1632 display_error(&buf[4]);
1636 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
1637 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1638 wprintf("<B>Confirm deletion of room</B>\n");
1639 wprintf("</FONT></TD></TR></TABLE>\n");
1641 wprintf("<CENTER>");
1642 wprintf("<FORM METHOD=\"GET\" ACTION=\"/delete_room\">\n");
1644 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1645 escputs(WC->wc_roomname);
1646 wprintf("</FONT>?<BR>\n");
1648 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1649 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1651 wprintf("</FORM></CENTER>\n");
1657 * Delete the current room
1659 void delete_room(void)
1664 strcpy(sc, bstr("sc"));
1666 if (strcasecmp(sc, "Delete")) {
1667 display_error("Cancelled. This room was not deleted.");
1670 serv_puts("KILL 1");
1672 if (buf[0] != '2') {
1673 display_error(&buf[4]);
1675 smart_goto("_BASEROOM_");
1682 * Perform changes to a room's network configuration
1684 void netedit(void) {
1689 if (strlen(bstr("line"))==0) {
1694 strcpy(line, bstr("prefix"));
1695 strcat(line, bstr("line"));
1696 strcat(line, bstr("suffix"));
1706 if (buf[0] != '1') {
1712 /* This loop works for add *or* remove. Spiffy, eh? */
1713 while (serv_gets(buf), strcmp(buf, "000")) {
1714 if (strcasecmp(buf, line)) {
1715 fprintf(fp, "%s\n", buf);
1722 if (buf[0] != '4') {
1728 while (fgets(buf, sizeof buf, fp) != NULL) {
1729 buf[strlen(buf)-1] = 0;
1733 if (!strcasecmp(bstr("cmd"), "add")) {
1745 * Convert a room name to a folder-ish-looking name.
1747 void room_to_folder(char *folder, char *room, int floor, int is_mailbox)
1752 * For mailboxes, just do it straight...
1755 sprintf(folder, "My folders|%s", room);
1759 * Otherwise, prefix the floor name as a "public folders" moniker
1762 sprintf(folder, "%s|%s", floorlist[floor], room);
1766 * Replace "/" characters with "|" for pseudo-folder-delimiting
1768 for (i=0; i<strlen(folder); ++i) {
1769 if (folder[i] == '/') folder[i] = '|';
1780 * Change the view for this room
1782 void change_view(void) {
1786 view = atol(bstr("view"));
1788 serv_printf("VIEW %d", view);
1790 smart_goto(WC->wc_roomname);
1795 * Show the room list in "folders" format. (only should get called by
1796 * knrooms() because that's where output_headers() is called from)
1798 void folders(void) {
1801 int levels, oldlevels;
1812 struct folder *fold = NULL;
1814 int max_folders = 0;
1815 int alloc_folders = 0;
1822 /* Start with the mailboxes */
1825 fold = malloc(sizeof(struct folder));
1826 memset(fold, 0, sizeof(struct folder));
1827 strcpy(fold[0].name, "My folders");
1828 fold[0].is_mailbox = 1;
1830 /* Then add floors */
1833 if (buf[0]=='1') while(serv_gets(buf), strcmp(buf, "000")) {
1834 if (max_folders >= alloc_folders) {
1835 alloc_folders = max_folders + 100;
1836 fold = realloc(fold,
1837 alloc_folders * sizeof(struct folder));
1839 memset(&fold[max_folders], 0, sizeof(struct folder));
1840 extract(fold[max_folders].name, buf, 1);
1845 for (p = 0; p < 2; ++p) {
1846 if (p == 0) serv_puts("LKRN");
1847 else if (p == 1) serv_puts("LKRO");
1849 if (buf[0]=='1') while(serv_gets(buf), strcmp(buf, "000")) {
1850 if (max_folders >= alloc_folders) {
1851 alloc_folders = max_folders + 100;
1852 fold = realloc(fold,
1853 alloc_folders * sizeof(struct folder));
1855 memset(&fold[max_folders], 0, sizeof(struct folder));
1856 extract(fold[max_folders].room, buf, 0);
1857 if (p == 0) fold[max_folders].hasnewmsgs = 1;
1858 flags = extract_int(buf, 1);
1859 floor = extract_int(buf, 2);
1860 if (flags & QR_MAILBOX) {
1861 fold[max_folders].is_mailbox = 1;
1863 room_to_folder(fold[max_folders].name,
1864 fold[max_folders].room,
1866 fold[max_folders].is_mailbox);
1867 fold[max_folders].selectable = 1;
1872 /* Bubble-sort the folder list */
1873 for (i=0; i<max_folders; ++i) {
1874 for (j=0; j<(max_folders-1)-i; ++j) {
1875 if (fold[j].is_mailbox == fold[j+1].is_mailbox) {
1876 swap = strcasecmp(fold[j].name, fold[j+1].name);
1879 if ( (fold[j+1].is_mailbox)
1880 && (!fold[j].is_mailbox)) {
1888 memcpy(&ftmp, &fold[j], sizeof(struct folder));
1889 memcpy(&fold[j], &fold[j+1],
1890 sizeof(struct folder));
1891 memcpy(&fold[j+1], &ftmp,
1892 sizeof(struct folder));
1901 for (i=0; i<max_folders; ++i) {
1903 levels = num_tokens(fold[i].name, '|');
1904 if (levels > oldlevels) {
1905 for (k=0; k<(levels-oldlevels); ++k) {
1909 if (levels < oldlevels) {
1910 for (k=0; k<(oldlevels-levels); ++k) {
1916 for (t=0; t<nests; ++t) wprintf(" ");
1917 if (fold[i].selectable) {
1918 wprintf("<A HREF=\"/dotgoto?room=");
1919 urlescputs(fold[i].room);
1925 if (fold[i].hasnewmsgs) wprintf("<B>");
1926 extract(buf, fold[i].name, levels-1);
1928 if (fold[i].hasnewmsgs) wprintf("</B>");
1929 if (fold[i].selectable) {
1935 if (!strcasecmp(fold[i].name, "My Folders|Mail")) {
1936 wprintf(" (INBOX)");
1940 while (nests-- > 0) ;;
1947 /* Do either a known rooms list or a folders list, depending on the
1951 char listviewpref[SIZ];
1956 /* Determine whether the user is trying to change views */
1957 if (bstr("view") != NULL) {
1958 if (strlen(bstr("view")) > 0) {
1959 set_preference("roomlistview", bstr("view"));
1963 get_preference("roomlistview", listviewpref);
1965 if (strcasecmp(listviewpref, "folders")) {
1966 strcpy(listviewpref, "rooms");
1970 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>"
1971 "<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>"
1973 if (!strcasecmp(listviewpref, "rooms")) {
1974 wprintf("Room list");
1976 if (!strcasecmp(listviewpref, "folders")) {
1977 wprintf("Folder list");
1979 wprintf("</B></TD>\n");
1982 /* offer the ability to switch views */
1983 wprintf("<TD><FORM NAME=\"roomlistomatic\">\n"
1984 "<SELECT NAME=\"newview\" SIZE=\"1\" "
1985 "OnChange=\"location.href=roomlistomatic.newview.options"
1986 "[selectedIndex].value\">\n");
1988 wprintf("<OPTION %s VALUE=\"/knrooms&view=rooms\">"
1991 ( !strcasecmp(listviewpref, "rooms") ? "SELECTED" : "" )
1994 wprintf("<OPTION %s VALUE=\"/knrooms&view=folders\">"
1995 "View as folder list"
1997 ( !strcasecmp(listviewpref, "folders") ? "SELECTED" : "" )
2000 wprintf("</SELECT></FORM></TD><TD>\n");
2002 wprintf("</TD></TR></TABLE><BR>\n");
2004 /* Display the room list in the user's preferred format */
2005 if (!strcasecmp(listviewpref, "folders")) {
2009 list_all_rooms_by_floor();