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("<SPAN CLASS=\"titlebar\">Zapped (forgotten) rooms</SPAN>\n");
275 wprintf("</TD></TR></TABLE><BR>\n");
277 wprintf("<BR><BR>\n");
278 wprintf("Click on any room to un-zap it and goto that room.\n");
284 * read this room's info file (set v to 1 for verbose mode)
300 /* Display room graphic. The server doesn't actually
301 * need the room name, but we supply it in order to
302 * keep the browser from using a cached graphic from
305 void embed_room_graphic(void) {
308 serv_puts("OIMG _roompic_");
311 wprintf("<TD BGCOLOR=\"#444455\">");
312 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
313 urlescputs(WC->wc_roomname);
322 /* Let the user know if new mail has arrived
324 void embed_newmail_button(void) {
325 if ( (WC->new_mail > WC->remember_new_mail) && (WC->new_mail>0) ) {
327 "<A HREF=\"/dotgoto?room=_MAIL_\">"
328 "<IMG SRC=\"/static/mail.gif\" border=0 "
329 "ALT=\"You have new mail\">"
330 "<BR><SPAN CLASS=\"youhavemail\">"
331 "%d new mail</SPAN></A>", WC->new_mail);
332 WC->remember_new_mail = WC->new_mail;
339 * Display the current view and offer an option to change it
341 void embed_view_o_matic(void) {
344 wprintf("<FORM NAME=\"viewomatic\">\n"
345 "<SELECT NAME=\"newview\" SIZE=\"1\" "
346 "OnChange=\"location.href=viewomatic.newview.options"
347 "[selectedIndex].value\">\n");
349 for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) {
351 * Only offer the views that make sense, given the default
352 * view for the room. For example, don't offer a Calendar
353 * view in a non-Calendar room.
357 || (i == WC->wc_default_view)
358 || ( (i == 0) && (WC->wc_default_view == 1) )
359 || ( (i == 1) && (WC->wc_default_view == 0) )
362 wprintf("<OPTION %s VALUE=\"/changeview?view=%d\">",
363 ((i == WC->wc_view) ? "SELECTED" : ""),
365 escputs(viewdefs[i]);
366 wprintf("</OPTION>\n");
369 wprintf("</SELECT></FORM>\n");
374 void embed_room_banner(char *got) {
377 /* We need to have the information returned by a GOTO server command.
378 * If it isn't supplied, we fake it by issuing our own GOTO.
381 serv_printf("GOTO %s", WC->wc_roomname);
386 /* If the user happens to select the "make this my start page" link,
387 * we want it to remember the URL as a "/dotskip" one instead of
388 * a "skip" or "gotonext" or something like that.
390 snprintf(WC->this_page, sizeof(WC->this_page), "/dotskip&room=%s",
393 /* Check for new mail. */
394 WC->new_mail = extract_int(&got[4], 9);
395 WC->wc_view = extract_int(&got[4], 11);
397 svprintf("ROOMNAME", WCS_STRING, "%s", WC->wc_roomname);
398 svprintf("NEWMSGS", WCS_STRING, "%d", extract_int(&got[4], 1));
399 svprintf("TOTALMSGS", WCS_STRING, "%d", extract_int(&got[4], 2));
400 svcallback("ROOMPIC", embed_room_graphic);
401 svcallback("ROOMINFO", readinfo);
402 svcallback("YOUHAVEMAIL", embed_newmail_button);
403 svcallback("VIEWOMATIC", embed_view_o_matic);
404 svcallback("START", offer_start_page);
406 do_template("roombanner");
407 clear_local_substs();
415 * generic routine to take the session to a new room
417 * display_name values: 0 = goto only
418 * 1 = goto and display
421 void gotoroom(char *gname, int display_name)
424 static long ls = (-1L);
429 wprintf("Pragma: no-cache\n");
430 wprintf("Cache-Control: no-store\n");
432 wprintf("<HTML><HEAD>\n"
433 "<META HTTP-EQUIV=\"refresh\" CONTENT=\"500363689;\">\n"
434 "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
435 "<META HTTP-EQUIV=\"expired\" CONTENT=\"28-May-1971 18:10:00 GMT\">\n"
436 "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\">\n"
438 do_template("background");
440 if (display_name != 2) {
441 /* store ungoto information */
442 strcpy(WC->ugname, WC->wc_roomname);
445 /* move to the new room */
446 serv_printf("GOTO %s", gname);
449 serv_puts("GOTO _BASEROOM_");
454 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
459 extract(WC->wc_roomname, &buf[4], 0);
460 WC->room_flags = extract_int(&buf[4], 4);
461 /* highest_msg_read = extract_int(&buf[4],6);
462 maxmsgnum = extract_int(&buf[4],5);
463 is_mail = (char) extract_int(&buf[4],7); */
464 ls = extract_long(&buf[4], 6);
467 WC->is_room_aide = WC->is_aide;
469 WC->is_room_aide = (char) extract_int(&buf[4], 8);
471 remove_march(WC->wc_roomname);
472 if (!strcasecmp(gname, "_BASEROOM_"))
475 /* Display the room banner */
477 embed_room_banner(buf);
480 strcpy(WC->wc_roomname, WC->wc_roomname);
481 WC->wc_view = extract_int(&buf[4], 11);
482 WC->wc_default_view = extract_int(&buf[4], 12);
487 * Locate the room on the march list which we most want to go to. Each room
488 * is measured given a "weight" of preference based on various factors.
490 char *pop_march(int desired_floor)
492 static char TheRoom[128];
494 int TheOrder = 32767;
497 struct march *mptr = NULL;
499 strcpy(TheRoom, "_BASEROOM_");
500 if (WC->march == NULL)
503 for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
505 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
506 weight = weight + 10000;
507 if (mptr->march_floor == desired_floor)
508 weight = weight + 5000;
510 weight = weight + ((128 - (mptr->march_floor)) * 128);
511 weight = weight + (128 - (mptr->march_order));
513 if (weight > TheWeight) {
515 strcpy(TheRoom, mptr->march_name);
516 TheFloor = mptr->march_floor;
517 TheOrder = mptr->march_order;
525 /* Goto next room having unread messages.
526 * We want to skip over rooms that the user has already been to, and take the
527 * user back to the lobby when done. The room we end up in is placed in
528 * newroom - which is set to 0 (the lobby) initially.
529 * We start the search in the current room rather than the beginning to prevent
530 * two or more concurrent users from dragging each other back to the same room.
535 struct march *mptr, *mptr2;
538 /* First check to see if the march-mode list is already allocated.
539 * If it is, pop the first room off the list and go there.
542 if (WC->march == NULL) {
546 while (serv_gets(buf), strcmp(buf, "000")) {
547 mptr = (struct march *) malloc(sizeof(struct march));
549 extract(mptr->march_name, buf, 0);
550 mptr->march_floor = extract_int(buf, 2);
551 mptr->march_order = extract_int(buf, 3);
552 if (WC->march == NULL) {
556 while (mptr2->next != NULL)
561 /* add _BASEROOM_ to the end of the march list, so the user will end up
562 * in the system base room (usually the Lobby>) at the end of the loop
564 mptr = (struct march *) malloc(sizeof(struct march));
566 strcpy(mptr->march_name, "_BASEROOM_");
567 if (WC->march == NULL) {
571 while (mptr2->next != NULL)
576 * ...and remove the room we're currently in, so a <G>oto doesn't make us
577 * walk around in circles
579 remove_march(WC->wc_roomname);
581 if (WC->march != NULL) {
582 strcpy(next_room, pop_march(-1));
584 strcpy(next_room, "_BASEROOM_");
588 smart_goto(next_room);
592 void smart_goto(char *next_room) {
593 gotoroom(next_room, 0);
600 * mark all messages in current room as having been read
602 void slrp_highest(void)
607 serv_puts("SLRP HIGHEST");
610 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
617 * un-goto the previous room
623 if (!strcmp(WC->ugname, "")) {
624 smart_goto(WC->wc_roomname);
627 serv_printf("GOTO %s", WC->ugname);
630 smart_goto(WC->wc_roomname);
633 if (WC->uglsn >= 0L) {
634 serv_printf("SLRP %ld", WC->uglsn);
637 strcpy(buf, WC->ugname);
638 strcpy(WC->ugname, "");
647 * Set/clear/read the "self-service list subscribe" flag for a room
649 * Set 'newval' to 0 to clear, 1 to set, any other value to leave unchanged.
650 * Always returns the new value.
653 int self_service(int newval) {
654 int current_value = 0;
660 int flags, floor, order, view, flags2;
664 if (buf[0] != '2') return(0);
666 extract(name, &buf[4], 0);
667 extract(password, &buf[4], 1);
668 extract(dirname, &buf[4], 2);
669 flags = extract_int(&buf[4], 3);
670 floor = extract_int(&buf[4], 4);
671 order = extract_int(&buf[4], 5);
672 view = extract_int(&buf[4], 6);
673 flags2 = extract_int(&buf[4], 7);
675 if (flags2 & QR2_SELFLIST) {
683 flags2 = flags2 | QR2_SELFLIST;
685 else if (newval == 0) {
686 flags2 = flags2 & ~QR2_SELFLIST;
689 return(current_value);
692 if (newval != current_value) {
693 serv_printf("SETR %s|%s|%s|%d|0|%d|%d|%d|%d",
694 name, password, dirname, flags,
695 floor, order, view, flags2);
709 * display the form for editing a room
711 void display_editroom(void)
718 char er_password[10];
720 char er_roomaide[26];
726 char *not_shared_with;
729 if (strlen(tab) == 0) tab = "admin";
735 display_error(&buf[4]);
738 extract(er_name, &buf[4], 0);
739 extract(er_password, &buf[4], 1);
740 extract(er_dirname, &buf[4], 2);
741 er_flags = extract_int(&buf[4], 3);
742 er_floor = extract_int(&buf[4], 4);
746 /* print the tabbed dialog */
747 wprintf("<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
748 "<TR ALIGN=CENTER BGCOLOR=\"#FFFFFF\">"
749 "<TD> </TD>\n");
751 if (!strcmp(tab, "admin")) {
752 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
755 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=admin\">");
757 wprintf("Room administration");
758 if (!strcmp(tab, "admin")) {
759 wprintf("</SPAN></TD>\n");
762 wprintf("</A></TD>\n");
765 wprintf("<TD> </TD>\n");
767 if (!strcmp(tab, "config")) {
768 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
771 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=config\">");
773 wprintf("Room configuration");
774 if (!strcmp(tab, "config")) {
775 wprintf("</SPAN></TD>\n");
778 wprintf("</A></TD>\n");
781 wprintf("<TD> </TD>\n");
783 if (!strcmp(tab, "sharing")) {
784 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
787 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=sharing\">");
790 if (!strcmp(tab, "sharing")) {
791 wprintf("</SPAN></TD>\n");
794 wprintf("</A></TD>\n");
797 wprintf("<TD> </TD>\n");
799 if (!strcmp(tab, "listserv")) {
800 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
803 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=listserv\">");
805 wprintf("Mailing list service");
806 if (!strcmp(tab, "listserv")) {
807 wprintf("</SPAN></TD>\n");
810 wprintf("</A></TD>\n");
813 wprintf("<TD> </TD></TR>"
814 "<TR><TD BGCOLOR=\"#000077\" COLSPAN=9 HEIGHT=5> </TD></TR>"
817 /* end tabbed dialog */
820 if (!strcmp(tab, "admin")) {
822 "<LI><A HREF=\"/confirm_delete_room\">\n"
823 "Delete this room</A>\n"
824 "<LI><A HREF=\"/display_editroompic\">\n"
825 "Set or change the graphic for this room's banner</A>\n"
826 "<LI><A HREF=\"/display_editinfo\">\n"
827 "Edit this room's Info file</A>\n"
831 if (!strcmp(tab, "config")) {
832 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
834 wprintf("<UL><LI>Name of room: ");
835 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
837 wprintf("<LI>Resides on floor: ");
839 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
840 for (i = 0; i < 128; ++i)
841 if (strlen(floorlist[i]) > 0) {
844 wprintf("SELECTED ");
845 wprintf("VALUE=\"%d\">", i);
846 escputs(floorlist[i]);
847 wprintf("</OPTION>\n");
849 wprintf("</SELECT>\n");
851 wprintf("<LI>Type of room:<UL>\n");
853 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
854 if ((er_flags & QR_PRIVATE) == 0)
856 wprintf("> Public room\n");
858 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
859 if ((er_flags & QR_PRIVATE) &&
860 (er_flags & QR_GUESSNAME))
862 wprintf("> Private - guess name\n");
864 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
865 if ((er_flags & QR_PRIVATE) &&
866 (er_flags & QR_PASSWORDED))
868 wprintf("> Private - require password:\n");
869 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
871 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
872 if ((er_flags & QR_PRIVATE)
873 && ((er_flags & QR_GUESSNAME) == 0)
874 && ((er_flags & QR_PASSWORDED) == 0))
876 wprintf("> Private - invitation only\n");
878 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
879 wprintf("> If private, cause current users to forget room\n");
883 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
884 if (er_flags & QR_PREFONLY)
886 wprintf("> Preferred users only\n");
888 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
889 if (er_flags & QR_READONLY)
891 wprintf("> Read-only room\n");
893 /* directory stuff */
894 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
895 if (er_flags & QR_DIRECTORY)
897 wprintf("> File directory room\n");
899 wprintf("<UL><LI>Directory name: ");
900 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
902 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
903 if (er_flags & QR_UPLOAD)
905 wprintf("> Uploading allowed\n");
907 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
908 if (er_flags & QR_DOWNLOAD)
910 wprintf("> Downloading allowed\n");
912 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
913 if (er_flags & QR_VISDIR)
915 wprintf("> Visible directory</UL>\n");
917 /* end of directory stuff */
919 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
920 if (er_flags & QR_NETWORK)
922 wprintf("> Network shared room\n");
924 /* start of anon options */
926 wprintf("<LI>Anonymous messages<UL>\n");
928 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
929 if (((er_flags & QR_ANONONLY) == 0)
930 && ((er_flags & QR_ANONOPT) == 0))
932 wprintf("> No anonymous messages\n");
934 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
935 if (er_flags & QR_ANONONLY)
937 wprintf("> All messages are anonymous\n");
939 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
940 if (er_flags & QR_ANONOPT)
942 wprintf("> Prompt user when entering messages</UL>\n");
944 /* end of anon options */
946 wprintf("<LI>Room aide: \n");
950 wprintf("<EM>%s</EM>\n", &buf[4]);
952 extract(er_roomaide, &buf[4], 0);
953 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
956 wprintf("</UL><CENTER>\n");
957 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
958 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
959 wprintf("</CENTER>\n");
963 /* Sharing the room with other Citadel nodes... */
964 if (!strcmp(tab, "sharing")) {
966 shared_with = strdup("");
967 not_shared_with = strdup("");
969 /* Learn the current configuration */
970 serv_puts("CONF getsys|application/x-citadel-ignet-config");
972 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
973 extract(node, buf, 0);
974 not_shared_with = realloc(not_shared_with,
975 strlen(not_shared_with) + 32);
976 strcat(not_shared_with, node);
977 strcat(not_shared_with, "|");
982 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
983 extract(cmd, buf, 0);
984 extract(node, buf, 1);
985 if (!strcasecmp(cmd, "ignet_push_share")) {
986 shared_with = realloc(shared_with,
987 strlen(shared_with) + 32);
988 strcat(shared_with, node);
989 strcat(shared_with, "|");
993 for (i=0; i<num_tokens(shared_with, '|'); ++i) {
994 extract(node, shared_with, i);
995 for (j=0; j<num_tokens(not_shared_with, '|'); ++j) {
996 extract(cmd, not_shared_with, j);
997 if (!strcasecmp(node, cmd)) {
998 remove_token(not_shared_with, j, '|');
1003 /* Display the stuff */
1004 wprintf("<CENTER><BR>"
1005 "<TABLE border=1 cellpadding=5><TR>"
1006 "<TD><B><I>Shared with</I></B></TD>"
1007 "<TD><B><I>Not shared with</I></B></TD></TR>\n"
1010 for (i=0; i<num_tokens(shared_with, '|'); ++i) {
1011 extract(node, shared_with, i);
1012 if (strlen(node) > 0) {
1013 wprintf("%s ", node);
1014 wprintf("<A HREF=\"/netedit&cmd=remove&line="
1015 "ignet_push_share|");
1017 wprintf("&tab=sharing\">(unshare)</A><BR>");
1021 wprintf("</TD><TD>\n");
1023 for (i=0; i<num_tokens(not_shared_with, '|'); ++i) {
1024 extract(node, not_shared_with, i);
1025 if (strlen(node) > 0) {
1026 wprintf("%s ", node);
1027 wprintf("<A HREF=\"/netedit&cmd=add&line="
1028 "ignet_push_share|");
1030 wprintf("&tab=sharing\">(share)</A><BR>");
1034 wprintf("</TD></TR>"
1036 "<I><B>Reminder:</B> When sharing a room, "
1037 "it must be shared from both ends. Adding a node to "
1038 "the 'shared' list sends messages out, but in order to"
1039 " receive messages, the other nodes must be configured"
1040 " to send messages out to your system as well.</I><BR>"
1045 /* Mailing list management */
1046 if (!strcmp(tab, "listserv")) {
1048 wprintf("<BR><center>"
1049 "<TABLE BORDER=0 WIDTH=100%% CELLPADDING=5>"
1050 "<TR><TD VALIGN=TOP>");
1052 wprintf("<i>The contents of this room are being "
1053 "mailed <b>as individual messages</b> "
1054 "to the following list recipients:"
1059 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
1060 extract(cmd, buf, 0);
1061 if (!strcasecmp(cmd, "listrecp")) {
1062 extract(recp, buf, 1);
1065 wprintf(" <A HREF=\"/netedit&cmd=remove&line="
1068 wprintf("&tab=listserv\">(remove)</A><BR>");
1072 wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/netedit\">\n"
1073 "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
1074 "<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"listrecp|\">\n");
1075 wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
1076 wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
1077 wprintf("</FORM>\n");
1079 wprintf("</TD><TD VALIGN=TOP>\n");
1081 wprintf("<i>The contents of this room are being "
1082 "mailed <b>in digest form</b> "
1083 "to the following list recipients:"
1088 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
1089 extract(cmd, buf, 0);
1090 if (!strcasecmp(cmd, "digestrecp")) {
1091 extract(recp, buf, 1);
1094 wprintf(" <A HREF=\"/netedit&cmd=remove&line="
1097 wprintf("&tab=listserv\">(remove)</A><BR>");
1101 wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/netedit\">\n"
1102 "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
1103 "<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"digestrecp|\">\n");
1104 wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
1105 wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
1106 wprintf("</FORM>\n");
1108 wprintf("</TD></TR></TABLE><HR>\n");
1110 if (self_service(999) == 1) {
1111 wprintf("This room is configured to allow "
1112 "self-service subscribe/unsubscribe requests."
1113 " <A HREF=\"/toggle_self_service?newval=0&"
1115 "Click to disable.</A><BR>\n"
1116 "The URL for subscribe/unsubscribe is: "
1117 "<TT>http://%s/listsub</TT><BR>\n",
1122 wprintf("This room is <i>not</i> configured to allow "
1123 "self-service subscribe/unsubscribe requests."
1124 " <A HREF=\"/toggle_self_service?newval=1&"
1126 "Click to enable.</A><BR>\n"
1131 wprintf("</CENTER>\n");
1139 * Toggle self-service list subscription
1141 void toggle_self_service(void) {
1144 newval = atoi(bstr("newval"));
1145 self_service(newval);
1152 * save new parameters for a room
1158 char er_password[10];
1159 char er_dirname[15];
1160 char er_roomaide[26];
1166 if (strcmp(bstr("sc"), "OK")) {
1167 display_error("Cancelled. Changes were not saved.");
1173 if (buf[0] != '2') {
1174 display_error(&buf[4]);
1177 extract(er_name, &buf[4], 0);
1178 extract(er_password, &buf[4], 1);
1179 extract(er_dirname, &buf[4], 2);
1180 er_flags = extract_int(&buf[4], 3);
1182 strcpy(er_roomaide, bstr("er_roomaide"));
1183 if (strlen(er_roomaide) == 0) {
1186 if (buf[0] != '2') {
1187 strcpy(er_roomaide, "");
1189 extract(er_roomaide, &buf[4], 0);
1192 strcpy(buf, bstr("er_name"));
1194 if (strlen(buf) > 0)
1195 strcpy(er_name, buf);
1197 strcpy(buf, bstr("er_password"));
1199 if (strlen(buf) > 0)
1200 strcpy(er_password, buf);
1202 strcpy(buf, bstr("er_dirname"));
1204 if (strlen(buf) > 0)
1205 strcpy(er_dirname, buf);
1207 strcpy(buf, bstr("type"));
1208 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
1210 if (!strcmp(buf, "invonly")) {
1211 er_flags |= (QR_PRIVATE);
1213 if (!strcmp(buf, "guessname")) {
1214 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
1216 if (!strcmp(buf, "passworded")) {
1217 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
1219 if (!strcmp(bstr("prefonly"), "yes")) {
1220 er_flags |= QR_PREFONLY;
1222 er_flags &= ~QR_PREFONLY;
1225 if (!strcmp(bstr("readonly"), "yes")) {
1226 er_flags |= QR_READONLY;
1228 er_flags &= ~QR_READONLY;
1231 if (!strcmp(bstr("network"), "yes")) {
1232 er_flags |= QR_NETWORK;
1234 er_flags &= ~QR_NETWORK;
1237 if (!strcmp(bstr("directory"), "yes")) {
1238 er_flags |= QR_DIRECTORY;
1240 er_flags &= ~QR_DIRECTORY;
1243 if (!strcmp(bstr("ulallowed"), "yes")) {
1244 er_flags |= QR_UPLOAD;
1246 er_flags &= ~QR_UPLOAD;
1249 if (!strcmp(bstr("dlallowed"), "yes")) {
1250 er_flags |= QR_DOWNLOAD;
1252 er_flags &= ~QR_DOWNLOAD;
1255 if (!strcmp(bstr("visdir"), "yes")) {
1256 er_flags |= QR_VISDIR;
1258 er_flags &= ~QR_VISDIR;
1261 strcpy(buf, bstr("anon"));
1263 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
1264 if (!strcmp(buf, "anononly"))
1265 er_flags |= QR_ANONONLY;
1266 if (!strcmp(buf, "anon2"))
1267 er_flags |= QR_ANONOPT;
1270 if (!strcmp(bstr("bump"), "yes"))
1273 er_floor = atoi(bstr("er_floor"));
1275 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
1276 er_name, er_password, er_dirname, er_flags, bump, er_floor);
1279 if (buf[0] != '2') {
1280 display_error(&buf[4]);
1283 gotoroom(er_name, 0);
1285 if (strlen(er_roomaide) > 0) {
1286 sprintf(buf, "SETA %s", er_roomaide);
1289 if (buf[0] != '2') {
1290 display_error(&buf[4]);
1294 smart_goto(er_name);
1298 * Invite, Kick, and show Who Knows a room
1300 void display_whok(void)
1302 char buf[SIZ], room[SIZ], username[SIZ];
1307 if (buf[0] != '2') {
1308 display_error(&buf[4]);
1311 extract(room, &buf[4], 0);
1313 strcpy(username, bstr("username"));
1317 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>");
1318 wprintf("<SPAN CLASS=\"titlebar\">Access control list for ");
1319 escputs(WC->wc_roomname);
1320 wprintf("</SPAN></TD></TR></TABLE>\n");
1322 if(!strcmp(bstr("sc"), "Kick")) {
1323 sprintf(buf, "KICK %s", username);
1327 if (buf[0] != '2') {
1328 display_error(&buf[4]);
1331 wprintf("<B><I>User %s kicked out of room %s.</I></B>\n",
1334 } else if(!strcmp(bstr("sc"), "Invite")) {
1335 sprintf(buf, "INVT %s", username);
1339 if (buf[0] != '2') {
1340 display_error(&buf[4]);
1343 wprintf("<B><I>User %s invited to room %s.</I></B>\n",
1350 wprintf("<TABLE border=0 CELLSPACING=10><TR VALIGN=TOP>"
1351 "<TD>The users listed below have access to this room. "
1352 "To remove a user from the access list, select the user "
1353 "name from the list and click 'Kick'.<BR><BR>");
1355 wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
1356 wprintf("<SELECT NAME=\"username\" SIZE=10>\n");
1359 if (buf[0] == '1') {
1360 while (serv_gets(buf), strcmp(buf, "000")) {
1361 extract(username, buf, 0);
1362 wprintf("<OPTION>");
1367 wprintf("</SELECT><BR>\n");
1369 wprintf("<input type=submit name=sc value=\"Kick\">");
1370 wprintf("</FORM></CENTER>\n");
1373 "To grant another user access to this room, enter the "
1374 "user name in the box below and click 'Invite'.<BR><BR>");
1376 wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
1377 wprintf("Invite: ");
1378 wprintf("<input type=text name=username><BR>\n"
1379 "<input type=hidden name=sc value=\"Invite\">"
1380 "<input type=submit value=\"Invite\">"
1381 "</FORM></CENTER>\n");
1383 wprintf("</TD></TR></TABLE>\n");
1390 * display the form for entering a new room
1392 void display_entroom(void)
1397 serv_puts("CRE8 0");
1400 if (buf[0] != '2') {
1401 display_error(&buf[4]);
1406 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>");
1407 wprintf("<SPAN CLASS=\"titlebar\">Enter (create) a new room</SPAN>\n");
1408 wprintf("</TD></TR></TABLE>\n");
1410 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
1412 wprintf("<UL><LI>Name of room: ");
1413 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
1415 wprintf("<LI>Type of room:<UL>\n");
1417 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
1418 wprintf("CHECKED > Public room\n");
1420 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
1421 wprintf("> Private - guess name\n");
1423 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
1424 wprintf("> Private - require password:\n");
1425 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
1427 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
1428 wprintf("> Private - invitation only\n");
1431 wprintf("<LI>Resides on floor: ");
1433 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
1434 for (i = 0; i < 128; ++i)
1435 if (strlen(floorlist[i]) > 0) {
1436 wprintf("<OPTION ");
1437 wprintf("VALUE=\"%d\">", i);
1438 escputs(floorlist[i]);
1439 wprintf("</OPTION>\n");
1441 wprintf("</SELECT>\n");
1445 wprintf("<CENTER>\n");
1446 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1447 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1448 wprintf("</CENTER>\n");
1449 wprintf("</FORM>\n<HR>");
1450 serv_printf("MESG roomaccess");
1452 if (buf[0] == '1') {
1468 char er_password[10];
1472 if (strcmp(bstr("sc"), "OK")) {
1473 display_error("Cancelled. No new room was created.");
1476 strcpy(er_name, bstr("er_name"));
1477 strcpy(er_type, bstr("type"));
1478 strcpy(er_password, bstr("er_password"));
1479 er_floor = atoi(bstr("er_floor"));
1482 if (!strcmp(er_type, "guessname"))
1484 if (!strcmp(er_type, "passworded"))
1486 if (!strcmp(er_type, "invonly"))
1489 sprintf(buf, "CRE8 1|%s|%d|%s|%d",
1490 er_name, er_num_type, er_password, er_floor);
1493 if (buf[0] != '2') {
1494 display_error(&buf[4]);
1497 smart_goto(er_name);
1502 * display the screen to enter a private room
1504 void display_private(char *rname, int req_pass)
1509 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
1510 wprintf("<SPAN CLASS=\"titlebar\">Goto a private room</SPAN>\n");
1511 wprintf("</TD></TR></TABLE>\n");
1513 wprintf("<CENTER>\n");
1514 wprintf("If you know the name of a hidden (guess-name) or\n");
1515 wprintf("passworded room, you can enter that room by typing\n");
1516 wprintf("its name below. Once you gain access to a private\n");
1517 wprintf("room, it will appear in your regular room listings\n");
1518 wprintf("so you don't have to keep returning here.\n");
1519 wprintf("<BR><BR>");
1521 wprintf("<FORM METHOD=\"GET\" ACTION=\"/goto_private\">\n");
1523 wprintf("<TABLE border><TR><TD>");
1524 wprintf("Enter room name:</TD><TD>");
1525 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1528 wprintf("</TD></TR><TR><TD>");
1529 wprintf("Enter room password:</TD><TD>");
1530 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1532 wprintf("</TD></TR></TABLE>\n");
1534 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1535 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1536 wprintf("</FORM>\n");
1541 * goto a private room
1543 void goto_private(void)
1548 if (strcasecmp(bstr("sc"), "OK")) {
1549 display_main_menu();
1552 strcpy(hold_rm, WC->wc_roomname);
1553 strcpy(buf, "GOTO ");
1554 strcat(buf, bstr("gr_name"));
1556 strcat(buf, bstr("gr_pass"));
1560 if (buf[0] == '2') {
1561 smart_goto(bstr("gr_name"));
1564 if (!strncmp(buf, "540", 3)) {
1565 display_private(bstr("gr_name"), 1);
1569 wprintf("%s\n", &buf[4]);
1576 * display the screen to zap a room
1578 void display_zap(void)
1582 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
1583 wprintf("<SPAN CLASS=\"titlebar\">Zap (forget) the current room</SPAN>\n");
1584 wprintf("</TD></TR></TABLE>\n");
1586 wprintf("If you select this option, <em>%s</em> will ", WC->wc_roomname);
1587 wprintf("disappear from your room list. Is this what you wish ");
1588 wprintf("to do?<BR>\n");
1590 wprintf("<FORM METHOD=\"GET\" ACTION=\"/zap\">\n");
1591 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1592 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1593 wprintf("</FORM>\n");
1604 char final_destination[SIZ];
1606 /* If the forget-room routine fails for any reason, we fall back
1607 * to the current room; otherwise, we go to the Lobby
1609 strcpy(final_destination, WC->wc_roomname);
1611 if (!strcasecmp(bstr("sc"), "OK")) {
1612 serv_printf("GOTO %s", WC->wc_roomname);
1614 if (buf[0] != '2') {
1615 /* ExpressMessageCat(&buf[4]); */
1619 if (buf[0] != '2') {
1620 /* ExpressMessageCat(&buf[4]); */
1622 strcpy(final_destination, "_BASEROOM_");
1626 smart_goto(final_destination);
1633 * Confirm deletion of the current room
1635 void confirm_delete_room(void)
1639 serv_puts("KILL 0");
1641 if (buf[0] != '2') {
1642 display_error(&buf[4]);
1646 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
1647 wprintf("<SPAN CLASS=\"titlebar\">Confirm deletion of room</SPAN>\n");
1648 wprintf("</TD></TR></TABLE>\n");
1650 wprintf("<CENTER>");
1651 wprintf("<FORM METHOD=\"GET\" ACTION=\"/delete_room\">\n");
1653 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1654 escputs(WC->wc_roomname);
1655 wprintf("</FONT>?<BR>\n");
1657 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1658 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1660 wprintf("</FORM></CENTER>\n");
1666 * Delete the current room
1668 void delete_room(void)
1673 strcpy(sc, bstr("sc"));
1675 if (strcasecmp(sc, "Delete")) {
1676 display_error("Cancelled. This room was not deleted.");
1679 serv_puts("KILL 1");
1681 if (buf[0] != '2') {
1682 display_error(&buf[4]);
1684 smart_goto("_BASEROOM_");
1691 * Perform changes to a room's network configuration
1693 void netedit(void) {
1698 if (strlen(bstr("line"))==0) {
1703 strcpy(line, bstr("prefix"));
1704 strcat(line, bstr("line"));
1705 strcat(line, bstr("suffix"));
1715 if (buf[0] != '1') {
1721 /* This loop works for add *or* remove. Spiffy, eh? */
1722 while (serv_gets(buf), strcmp(buf, "000")) {
1723 if (strcasecmp(buf, line)) {
1724 fprintf(fp, "%s\n", buf);
1731 if (buf[0] != '4') {
1737 while (fgets(buf, sizeof buf, fp) != NULL) {
1738 buf[strlen(buf)-1] = 0;
1742 if (!strcasecmp(bstr("cmd"), "add")) {
1754 * Convert a room name to a folder-ish-looking name.
1756 void room_to_folder(char *folder, char *room, int floor, int is_mailbox)
1761 * For mailboxes, just do it straight...
1764 sprintf(folder, "My folders|%s", room);
1768 * Otherwise, prefix the floor name as a "public folders" moniker
1771 sprintf(folder, "%s|%s", floorlist[floor], room);
1775 * Replace "/" characters with "|" for pseudo-folder-delimiting
1777 for (i=0; i<strlen(folder); ++i) {
1778 if (folder[i] == '/') folder[i] = '|';
1789 * Change the view for this room
1791 void change_view(void) {
1795 view = atol(bstr("view"));
1797 serv_printf("VIEW %d", view);
1799 smart_goto(WC->wc_roomname);
1804 * Show the room list in "folders" format. (only should get called by
1805 * knrooms() because that's where output_headers() is called from)
1807 void folders(void) {
1810 int levels, oldlevels;
1821 struct folder *fold = NULL;
1823 int max_folders = 0;
1824 int alloc_folders = 0;
1831 /* Start with the mailboxes */
1834 fold = malloc(sizeof(struct folder));
1835 memset(fold, 0, sizeof(struct folder));
1836 strcpy(fold[0].name, "My folders");
1837 fold[0].is_mailbox = 1;
1839 /* Then add floors */
1842 if (buf[0]=='1') while(serv_gets(buf), strcmp(buf, "000")) {
1843 if (max_folders >= alloc_folders) {
1844 alloc_folders = max_folders + 100;
1845 fold = realloc(fold,
1846 alloc_folders * sizeof(struct folder));
1848 memset(&fold[max_folders], 0, sizeof(struct folder));
1849 extract(fold[max_folders].name, buf, 1);
1856 if (buf[0]=='1') while(serv_gets(buf), strcmp(buf, "000")) {
1857 if (max_folders >= alloc_folders) {
1858 alloc_folders = max_folders + 100;
1859 fold = realloc(fold,
1860 alloc_folders * sizeof(struct folder));
1862 memset(&fold[max_folders], 0, sizeof(struct folder));
1863 extract(fold[max_folders].room, buf, 0);
1864 ra_flags = extract_int(buf, 5);
1865 flags = extract_int(buf, 1);
1866 floor = extract_int(buf, 2);
1867 fold[max_folders].hasnewmsgs =
1868 ((ra_flags & UA_HASNEWMSGS) ? 1 : 0 );
1869 if (flags & QR_MAILBOX) {
1870 fold[max_folders].is_mailbox = 1;
1872 room_to_folder(fold[max_folders].name,
1873 fold[max_folders].room,
1875 fold[max_folders].is_mailbox);
1876 fold[max_folders].selectable = 1;
1880 /* Bubble-sort the folder list */
1881 for (i=0; i<max_folders; ++i) {
1882 for (j=0; j<(max_folders-1)-i; ++j) {
1883 if (fold[j].is_mailbox == fold[j+1].is_mailbox) {
1884 swap = strcasecmp(fold[j].name, fold[j+1].name);
1887 if ( (fold[j+1].is_mailbox)
1888 && (!fold[j].is_mailbox)) {
1896 memcpy(&ftmp, &fold[j], sizeof(struct folder));
1897 memcpy(&fold[j], &fold[j+1],
1898 sizeof(struct folder));
1899 memcpy(&fold[j+1], &ftmp,
1900 sizeof(struct folder));
1909 for (i=0; i<max_folders; ++i) {
1911 levels = num_tokens(fold[i].name, '|');
1912 if (levels > oldlevels) {
1913 for (k=0; k<(levels-oldlevels); ++k) {
1917 if (levels < oldlevels) {
1918 for (k=0; k<(oldlevels-levels); ++k) {
1924 for (t=0; t<nests; ++t) wprintf(" ");
1925 if (fold[i].selectable) {
1926 wprintf("<A HREF=\"/dotgoto?room=");
1927 urlescputs(fold[i].room);
1933 if (fold[i].hasnewmsgs) wprintf("<B>");
1934 extract(buf, fold[i].name, levels-1);
1936 if (fold[i].hasnewmsgs) wprintf("</B>");
1937 if (fold[i].selectable) {
1943 if (!strcasecmp(fold[i].name, "My Folders|Mail")) {
1944 wprintf(" (INBOX)");
1948 while (nests-- > 0) ;;
1955 /* Do either a known rooms list or a folders list, depending on the
1959 char listviewpref[SIZ];
1964 /* Determine whether the user is trying to change views */
1965 if (bstr("view") != NULL) {
1966 if (strlen(bstr("view")) > 0) {
1967 set_preference("roomlistview", bstr("view"));
1971 get_preference("roomlistview", listviewpref);
1973 if (strcasecmp(listviewpref, "folders")) {
1974 strcpy(listviewpref, "rooms");
1978 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>"
1979 "<SPAN CLASS=\"titlebar\">"
1981 if (!strcasecmp(listviewpref, "rooms")) {
1982 wprintf("Room list");
1984 if (!strcasecmp(listviewpref, "folders")) {
1985 wprintf("Folder list");
1987 wprintf("</SPAN></TD>\n");
1990 /* offer the ability to switch views */
1991 wprintf("<TD><FORM NAME=\"roomlistomatic\">\n"
1992 "<SELECT NAME=\"newview\" SIZE=\"1\" "
1993 "OnChange=\"location.href=roomlistomatic.newview.options"
1994 "[selectedIndex].value\">\n");
1996 wprintf("<OPTION %s VALUE=\"/knrooms&view=rooms\">"
1999 ( !strcasecmp(listviewpref, "rooms") ? "SELECTED" : "" )
2002 wprintf("<OPTION %s VALUE=\"/knrooms&view=folders\">"
2003 "View as folder list"
2005 ( !strcasecmp(listviewpref, "folders") ? "SELECTED" : "" )
2008 wprintf("</SELECT></FORM></TD><TD>\n");
2010 wprintf("</TD></TR></TABLE><BR>\n");
2012 /* Display the room list in the user's preferred format */
2013 if (!strcasecmp(listviewpref, "folders")) {
2017 list_all_rooms_by_floor();