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)
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 room_tree_list(rp->rnext);
126 * Room ordering stuff (compare first by floor, then by order)
128 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
130 if ((r1 == NULL) && (r2 == NULL))
136 if (r1->rlfloor < r2->rlfloor)
138 if (r1->rlfloor > r2->rlfloor)
140 if (r1->rlorder < r2->rlorder)
142 if (r1->rlorder > r2->rlorder)
149 * Common code for all room listings
151 void listrms(char *variety)
156 struct roomlisting *rl = NULL;
157 struct roomlisting *rp;
158 struct roomlisting *rs;
161 /* Ask the server for a room list */
168 while (serv_gets(buf), strcmp(buf, "000")) {
170 rp = malloc(sizeof(struct roomlisting));
171 extract(rp->rlname, buf, 0);
172 rp->rlflags = extract_int(buf, 1);
173 rp->rlfloor = extract_int(buf, 2);
174 rp->rlorder = extract_int(buf, 3);
183 if (rordercmp(rp, rs) < 0) {
184 if (rs->lnext == NULL) {
191 if (rs->rnext == NULL) {
203 /* If no rooms were listed, print an nbsp to make the cell
204 * borders show up anyway.
206 if (num_rooms == 0) wprintf(" ");
218 * list all rooms by floor (only should get called from knrooms() because
219 * that's where output_headers() is called from)
221 void list_all_rooms_by_floor(void)
226 wprintf("<TABLE width=100%% border><TR><TH>Floor</TH>");
227 wprintf("<TH>Rooms with new messages</TH>");
228 wprintf("<TH>Rooms with no new messages</TH></TR>\n");
230 for (a = 0; a < 128; ++a)
231 if (floorlist[a][0] != 0) {
233 /* Floor name column */
236 serv_printf("OIMG _floorpic_|%d", a);
241 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
242 a, &floorlist[a][0]);
244 escputs(&floorlist[a][0]);
249 /* Rooms with new messages column */
251 sprintf(buf, "LKRN %d", a);
253 wprintf("</TD>\n<TD>");
255 /* Rooms with old messages column */
256 sprintf(buf, "LKRO %d", a);
258 wprintf("</TD></TR>\n");
260 wprintf("</TABLE>\n");
266 * list all forgotten rooms
268 void zapped_list(void)
271 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
272 wprintf("<SPAN CLASS=\"titlebar\">Zapped (forgotten) rooms</SPAN>\n");
273 wprintf("</TD></TR></TABLE><BR>\n");
275 wprintf("<BR><BR>\n");
276 wprintf("Click on any room to un-zap it and goto that room.\n");
282 * read this room's info file (set v to 1 for verbose mode)
298 /* Display room graphic. The server doesn't actually
299 * need the room name, but we supply it in order to
300 * keep the browser from using a cached graphic from
303 void embed_room_graphic(void) {
306 serv_puts("OIMG _roompic_");
309 wprintf("<TD BGCOLOR=\"#444455\">");
310 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
311 urlescputs(WC->wc_roomname);
320 /* Let the user know if new mail has arrived
322 void embed_newmail_button(void) {
323 if ( (WC->new_mail > WC->remember_new_mail) && (WC->new_mail>0) ) {
325 "<A HREF=\"/dotgoto?room=_MAIL_\">"
326 "<IMG SRC=\"/static/mail.gif\" border=0 "
327 "ALT=\"You have new mail\">"
328 "<BR><SPAN CLASS=\"youhavemail\">"
329 "%d new mail</SPAN></A>", WC->new_mail);
330 WC->remember_new_mail = WC->new_mail;
337 * Display the current view and offer an option to change it
339 void embed_view_o_matic(void) {
342 wprintf("<FORM NAME=\"viewomatic\">\n"
343 "<SELECT NAME=\"newview\" SIZE=\"1\" "
344 "OnChange=\"location.href=viewomatic.newview.options"
345 "[selectedIndex].value\">\n");
347 for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) {
349 * Only offer the views that make sense, given the default
350 * view for the room. For example, don't offer a Calendar
351 * view in a non-Calendar room.
355 || (i == WC->wc_default_view)
356 || ( (i == 0) && (WC->wc_default_view == 1) )
357 || ( (i == 1) && (WC->wc_default_view == 0) )
360 wprintf("<OPTION %s VALUE=\"/changeview?view=%d\">",
361 ((i == WC->wc_view) ? "SELECTED" : ""),
363 escputs(viewdefs[i]);
364 wprintf("</OPTION>\n");
367 wprintf("</SELECT></FORM>\n");
372 void embed_room_banner(char *got) {
375 /* We need to have the information returned by a GOTO server command.
376 * If it isn't supplied, we fake it by issuing our own GOTO.
379 serv_printf("GOTO %s", WC->wc_roomname);
384 /* If the user happens to select the "make this my start page" link,
385 * we want it to remember the URL as a "/dotskip" one instead of
386 * a "skip" or "gotonext" or something like that.
388 snprintf(WC->this_page, sizeof(WC->this_page), "/dotskip&room=%s",
391 /* Check for new mail. */
392 WC->new_mail = extract_int(&got[4], 9);
393 WC->wc_view = extract_int(&got[4], 11);
395 svprintf("ROOMNAME", WCS_STRING, "%s", WC->wc_roomname);
396 svprintf("NEWMSGS", WCS_STRING, "%d", extract_int(&got[4], 1));
397 svprintf("TOTALMSGS", WCS_STRING, "%d", extract_int(&got[4], 2));
398 svcallback("ROOMPIC", embed_room_graphic);
399 svcallback("ROOMINFO", readinfo);
400 svcallback("YOUHAVEMAIL", embed_newmail_button);
401 svcallback("VIEWOMATIC", embed_view_o_matic);
402 svcallback("START", offer_start_page);
404 do_template("roombanner");
405 clear_local_substs();
413 * generic routine to take the session to a new room
415 * display_name values: 0 = goto only
416 * 1 = goto and display
419 void gotoroom(char *gname, int display_name)
422 static long ls = (-1L);
427 wprintf("Pragma: no-cache\n");
428 wprintf("Cache-Control: no-store\n");
430 wprintf("<HTML><HEAD>\n"
431 "<META HTTP-EQUIV=\"refresh\" CONTENT=\"500363689;\">\n"
432 "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
433 "<META HTTP-EQUIV=\"expired\" CONTENT=\"28-May-1971 18:10:00 GMT\">\n"
434 "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\">\n"
436 do_template("background");
438 if (display_name != 2) {
439 /* store ungoto information */
440 strcpy(WC->ugname, WC->wc_roomname);
443 /* move to the new room */
444 serv_printf("GOTO %s", gname);
447 serv_puts("GOTO _BASEROOM_");
452 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
457 extract(WC->wc_roomname, &buf[4], 0);
458 WC->room_flags = extract_int(&buf[4], 4);
459 /* highest_msg_read = extract_int(&buf[4],6);
460 maxmsgnum = extract_int(&buf[4],5);
461 is_mail = (char) extract_int(&buf[4],7); */
462 ls = extract_long(&buf[4], 6);
465 WC->is_room_aide = WC->is_aide;
467 WC->is_room_aide = (char) extract_int(&buf[4], 8);
469 remove_march(WC->wc_roomname);
470 if (!strcasecmp(gname, "_BASEROOM_"))
473 /* Display the room banner */
475 embed_room_banner(buf);
478 strcpy(WC->wc_roomname, WC->wc_roomname);
479 WC->wc_view = extract_int(&buf[4], 11);
480 WC->wc_default_view = extract_int(&buf[4], 12);
485 * Locate the room on the march list which we most want to go to. Each room
486 * is measured given a "weight" of preference based on various factors.
488 char *pop_march(int desired_floor)
490 static char TheRoom[128];
492 int TheOrder = 32767;
495 struct march *mptr = NULL;
497 strcpy(TheRoom, "_BASEROOM_");
498 if (WC->march == NULL)
501 for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
503 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
504 weight = weight + 10000;
505 if (mptr->march_floor == desired_floor)
506 weight = weight + 5000;
508 weight = weight + ((128 - (mptr->march_floor)) * 128);
509 weight = weight + (128 - (mptr->march_order));
511 if (weight > TheWeight) {
513 strcpy(TheRoom, mptr->march_name);
514 TheFloor = mptr->march_floor;
515 TheOrder = mptr->march_order;
523 /* Goto next room having unread messages.
524 * We want to skip over rooms that the user has already been to, and take the
525 * user back to the lobby when done. The room we end up in is placed in
526 * newroom - which is set to 0 (the lobby) initially.
527 * We start the search in the current room rather than the beginning to prevent
528 * two or more concurrent users from dragging each other back to the same room.
533 struct march *mptr, *mptr2;
536 /* First check to see if the march-mode list is already allocated.
537 * If it is, pop the first room off the list and go there.
540 if (WC->march == NULL) {
544 while (serv_gets(buf), strcmp(buf, "000")) {
545 mptr = (struct march *) malloc(sizeof(struct march));
547 extract(mptr->march_name, buf, 0);
548 mptr->march_floor = extract_int(buf, 2);
549 mptr->march_order = extract_int(buf, 3);
550 if (WC->march == NULL) {
554 while (mptr2->next != NULL)
559 /* add _BASEROOM_ to the end of the march list, so the user will end up
560 * in the system base room (usually the Lobby>) at the end of the loop
562 mptr = (struct march *) malloc(sizeof(struct march));
564 strcpy(mptr->march_name, "_BASEROOM_");
565 if (WC->march == NULL) {
569 while (mptr2->next != NULL)
574 * ...and remove the room we're currently in, so a <G>oto doesn't make us
575 * walk around in circles
577 remove_march(WC->wc_roomname);
579 if (WC->march != NULL) {
580 strcpy(next_room, pop_march(-1));
582 strcpy(next_room, "_BASEROOM_");
586 smart_goto(next_room);
590 void smart_goto(char *next_room) {
591 gotoroom(next_room, 0);
598 * mark all messages in current room as having been read
600 void slrp_highest(void)
605 serv_puts("SLRP HIGHEST");
608 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
615 * un-goto the previous room
621 if (!strcmp(WC->ugname, "")) {
622 smart_goto(WC->wc_roomname);
625 serv_printf("GOTO %s", WC->ugname);
628 smart_goto(WC->wc_roomname);
631 if (WC->uglsn >= 0L) {
632 serv_printf("SLRP %ld", WC->uglsn);
635 strcpy(buf, WC->ugname);
636 strcpy(WC->ugname, "");
645 * Set/clear/read the "self-service list subscribe" flag for a room
647 * Set 'newval' to 0 to clear, 1 to set, any other value to leave unchanged.
648 * Always returns the new value.
651 int self_service(int newval) {
652 int current_value = 0;
658 int flags, floor, order, view, flags2;
662 if (buf[0] != '2') return(0);
664 extract(name, &buf[4], 0);
665 extract(password, &buf[4], 1);
666 extract(dirname, &buf[4], 2);
667 flags = extract_int(&buf[4], 3);
668 floor = extract_int(&buf[4], 4);
669 order = extract_int(&buf[4], 5);
670 view = extract_int(&buf[4], 6);
671 flags2 = extract_int(&buf[4], 7);
673 if (flags2 & QR2_SELFLIST) {
681 flags2 = flags2 | QR2_SELFLIST;
683 else if (newval == 0) {
684 flags2 = flags2 & ~QR2_SELFLIST;
687 return(current_value);
690 if (newval != current_value) {
691 serv_printf("SETR %s|%s|%s|%d|0|%d|%d|%d|%d",
692 name, password, dirname, flags,
693 floor, order, view, flags2);
707 * display the form for editing a room
709 void display_editroom(void)
716 char er_password[10];
718 char er_roomaide[26];
724 char *not_shared_with;
727 if (strlen(tab) == 0) tab = "admin";
733 display_error(&buf[4]);
736 extract(er_name, &buf[4], 0);
737 extract(er_password, &buf[4], 1);
738 extract(er_dirname, &buf[4], 2);
739 er_flags = extract_int(&buf[4], 3);
740 er_floor = extract_int(&buf[4], 4);
744 /* print the tabbed dialog */
745 wprintf("<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
746 "<TR ALIGN=CENTER BGCOLOR=\"#FFFFFF\">"
747 "<TD> </TD>\n");
749 if (!strcmp(tab, "admin")) {
750 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
753 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=admin\">");
755 wprintf("Room administration");
756 if (!strcmp(tab, "admin")) {
757 wprintf("</SPAN></TD>\n");
760 wprintf("</A></TD>\n");
763 wprintf("<TD> </TD>\n");
765 if (!strcmp(tab, "config")) {
766 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
769 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=config\">");
771 wprintf("Room configuration");
772 if (!strcmp(tab, "config")) {
773 wprintf("</SPAN></TD>\n");
776 wprintf("</A></TD>\n");
779 wprintf("<TD> </TD>\n");
781 if (!strcmp(tab, "sharing")) {
782 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
785 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=sharing\">");
788 if (!strcmp(tab, "sharing")) {
789 wprintf("</SPAN></TD>\n");
792 wprintf("</A></TD>\n");
795 wprintf("<TD> </TD>\n");
797 if (!strcmp(tab, "listserv")) {
798 wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
801 wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=listserv\">");
803 wprintf("Mailing list service");
804 if (!strcmp(tab, "listserv")) {
805 wprintf("</SPAN></TD>\n");
808 wprintf("</A></TD>\n");
811 wprintf("<TD> </TD></TR>"
812 "<TR><TD BGCOLOR=\"#000077\" COLSPAN=9 HEIGHT=5> </TD></TR>"
815 /* end tabbed dialog */
818 if (!strcmp(tab, "admin")) {
820 "<LI><A HREF=\"/confirm_delete_room\">\n"
821 "Delete this room</A>\n"
822 "<LI><A HREF=\"/display_editroompic\">\n"
823 "Set or change the graphic for this room's banner</A>\n"
824 "<LI><A HREF=\"/display_editinfo\">\n"
825 "Edit this room's Info file</A>\n"
829 if (!strcmp(tab, "config")) {
830 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
832 wprintf("<UL><LI>Name of room: ");
833 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
835 wprintf("<LI>Resides on floor: ");
837 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
838 for (i = 0; i < 128; ++i)
839 if (strlen(floorlist[i]) > 0) {
842 wprintf("SELECTED ");
843 wprintf("VALUE=\"%d\">", i);
844 escputs(floorlist[i]);
845 wprintf("</OPTION>\n");
847 wprintf("</SELECT>\n");
849 wprintf("<LI>Type of room:<UL>\n");
851 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
852 if ((er_flags & QR_PRIVATE) == 0)
854 wprintf("> Public room\n");
856 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
857 if ((er_flags & QR_PRIVATE) &&
858 (er_flags & QR_GUESSNAME))
860 wprintf("> Private - guess name\n");
862 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
863 if ((er_flags & QR_PRIVATE) &&
864 (er_flags & QR_PASSWORDED))
866 wprintf("> Private - require password:\n");
867 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
869 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
870 if ((er_flags & QR_PRIVATE)
871 && ((er_flags & QR_GUESSNAME) == 0)
872 && ((er_flags & QR_PASSWORDED) == 0))
874 wprintf("> Private - invitation only\n");
876 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
877 wprintf("> If private, cause current users to forget room\n");
881 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
882 if (er_flags & QR_PREFONLY)
884 wprintf("> Preferred users only\n");
886 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
887 if (er_flags & QR_READONLY)
889 wprintf("> Read-only room\n");
891 /* directory stuff */
892 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
893 if (er_flags & QR_DIRECTORY)
895 wprintf("> File directory room\n");
897 wprintf("<UL><LI>Directory name: ");
898 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
900 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
901 if (er_flags & QR_UPLOAD)
903 wprintf("> Uploading allowed\n");
905 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
906 if (er_flags & QR_DOWNLOAD)
908 wprintf("> Downloading allowed\n");
910 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
911 if (er_flags & QR_VISDIR)
913 wprintf("> Visible directory</UL>\n");
915 /* end of directory stuff */
917 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
918 if (er_flags & QR_NETWORK)
920 wprintf("> Network shared room\n");
922 /* start of anon options */
924 wprintf("<LI>Anonymous messages<UL>\n");
926 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
927 if (((er_flags & QR_ANONONLY) == 0)
928 && ((er_flags & QR_ANONOPT) == 0))
930 wprintf("> No anonymous messages\n");
932 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
933 if (er_flags & QR_ANONONLY)
935 wprintf("> All messages are anonymous\n");
937 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
938 if (er_flags & QR_ANONOPT)
940 wprintf("> Prompt user when entering messages</UL>\n");
942 /* end of anon options */
944 wprintf("<LI>Room aide: \n");
948 wprintf("<EM>%s</EM>\n", &buf[4]);
950 extract(er_roomaide, &buf[4], 0);
951 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
954 wprintf("</UL><CENTER>\n");
955 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
956 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
957 wprintf("</CENTER>\n");
961 /* Sharing the room with other Citadel nodes... */
962 if (!strcmp(tab, "sharing")) {
964 shared_with = strdup("");
965 not_shared_with = strdup("");
967 /* Learn the current configuration */
968 serv_puts("CONF getsys|application/x-citadel-ignet-config");
970 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
971 extract(node, buf, 0);
972 not_shared_with = realloc(not_shared_with,
973 strlen(not_shared_with) + 32);
974 strcat(not_shared_with, node);
975 strcat(not_shared_with, "|");
980 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
981 extract(cmd, buf, 0);
982 extract(node, buf, 1);
983 if (!strcasecmp(cmd, "ignet_push_share")) {
984 shared_with = realloc(shared_with,
985 strlen(shared_with) + 32);
986 strcat(shared_with, node);
987 strcat(shared_with, "|");
991 for (i=0; i<num_tokens(shared_with, '|'); ++i) {
992 extract(node, shared_with, i);
993 for (j=0; j<num_tokens(not_shared_with, '|'); ++j) {
994 extract(cmd, not_shared_with, j);
995 if (!strcasecmp(node, cmd)) {
996 remove_token(not_shared_with, j, '|');
1001 /* Display the stuff */
1002 wprintf("<CENTER><BR>"
1003 "<TABLE border=1 cellpadding=5><TR>"
1004 "<TD><B><I>Shared with</I></B></TD>"
1005 "<TD><B><I>Not shared with</I></B></TD></TR>\n"
1008 for (i=0; i<num_tokens(shared_with, '|'); ++i) {
1009 extract(node, shared_with, i);
1010 if (strlen(node) > 0) {
1011 wprintf("%s ", node);
1012 wprintf("<A HREF=\"/netedit&cmd=remove&line="
1013 "ignet_push_share|");
1015 wprintf("&tab=sharing\">(unshare)</A><BR>");
1019 wprintf("</TD><TD>\n");
1021 for (i=0; i<num_tokens(not_shared_with, '|'); ++i) {
1022 extract(node, not_shared_with, i);
1023 if (strlen(node) > 0) {
1024 wprintf("%s ", node);
1025 wprintf("<A HREF=\"/netedit&cmd=add&line="
1026 "ignet_push_share|");
1028 wprintf("&tab=sharing\">(share)</A><BR>");
1032 wprintf("</TD></TR>"
1034 "<I><B>Reminder:</B> When sharing a room, "
1035 "it must be shared from both ends. Adding a node to "
1036 "the 'shared' list sends messages out, but in order to"
1037 " receive messages, the other nodes must be configured"
1038 " to send messages out to your system as well.</I><BR>"
1043 /* Mailing list management */
1044 if (!strcmp(tab, "listserv")) {
1046 wprintf("<BR><center>"
1047 "<TABLE BORDER=0 WIDTH=100%% CELLPADDING=5>"
1048 "<TR><TD VALIGN=TOP>");
1050 wprintf("<i>The contents of this room are being "
1051 "mailed <b>as individual messages</b> "
1052 "to the following list recipients:"
1057 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
1058 extract(cmd, buf, 0);
1059 if (!strcasecmp(cmd, "listrecp")) {
1060 extract(recp, buf, 1);
1063 wprintf(" <A HREF=\"/netedit&cmd=remove&line="
1066 wprintf("&tab=listserv\">(remove)</A><BR>");
1070 wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/netedit\">\n"
1071 "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
1072 "<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"listrecp|\">\n");
1073 wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
1074 wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
1075 wprintf("</FORM>\n");
1077 wprintf("</TD><TD VALIGN=TOP>\n");
1079 wprintf("<i>The contents of this room are being "
1080 "mailed <b>in digest form</b> "
1081 "to the following list recipients:"
1086 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf, "000")) {
1087 extract(cmd, buf, 0);
1088 if (!strcasecmp(cmd, "digestrecp")) {
1089 extract(recp, buf, 1);
1092 wprintf(" <A HREF=\"/netedit&cmd=remove&line="
1095 wprintf("&tab=listserv\">(remove)</A><BR>");
1099 wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/netedit\">\n"
1100 "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
1101 "<INPUT TYPE=\"hidden\" NAME=\"prefix\" VALUE=\"digestrecp|\">\n");
1102 wprintf("<INPUT TYPE=\"text\" NAME=\"line\">\n");
1103 wprintf("<INPUT TYPE=\"submit\" NAME=\"cmd\" VALUE=\"Add\">");
1104 wprintf("</FORM>\n");
1106 wprintf("</TD></TR></TABLE><HR>\n");
1108 if (self_service(999) == 1) {
1109 wprintf("This room is configured to allow "
1110 "self-service subscribe/unsubscribe requests."
1111 " <A HREF=\"/toggle_self_service?newval=0&"
1113 "Click to disable.</A><BR>\n"
1114 "The URL for subscribe/unsubscribe is: "
1115 "<TT>http://%s/listsub</TT><BR>\n",
1120 wprintf("This room is <i>not</i> configured to allow "
1121 "self-service subscribe/unsubscribe requests."
1122 " <A HREF=\"/toggle_self_service?newval=1&"
1124 "Click to enable.</A><BR>\n"
1129 wprintf("</CENTER>\n");
1137 * Toggle self-service list subscription
1139 void toggle_self_service(void) {
1142 newval = atoi(bstr("newval"));
1143 self_service(newval);
1150 * save new parameters for a room
1156 char er_password[10];
1157 char er_dirname[15];
1158 char er_roomaide[26];
1164 if (strcmp(bstr("sc"), "OK")) {
1165 display_error("Cancelled. Changes were not saved.");
1171 if (buf[0] != '2') {
1172 display_error(&buf[4]);
1175 extract(er_name, &buf[4], 0);
1176 extract(er_password, &buf[4], 1);
1177 extract(er_dirname, &buf[4], 2);
1178 er_flags = extract_int(&buf[4], 3);
1180 strcpy(er_roomaide, bstr("er_roomaide"));
1181 if (strlen(er_roomaide) == 0) {
1184 if (buf[0] != '2') {
1185 strcpy(er_roomaide, "");
1187 extract(er_roomaide, &buf[4], 0);
1190 strcpy(buf, bstr("er_name"));
1192 if (strlen(buf) > 0)
1193 strcpy(er_name, buf);
1195 strcpy(buf, bstr("er_password"));
1197 if (strlen(buf) > 0)
1198 strcpy(er_password, buf);
1200 strcpy(buf, bstr("er_dirname"));
1202 if (strlen(buf) > 0)
1203 strcpy(er_dirname, buf);
1205 strcpy(buf, bstr("type"));
1206 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
1208 if (!strcmp(buf, "invonly")) {
1209 er_flags |= (QR_PRIVATE);
1211 if (!strcmp(buf, "guessname")) {
1212 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
1214 if (!strcmp(buf, "passworded")) {
1215 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
1217 if (!strcmp(bstr("prefonly"), "yes")) {
1218 er_flags |= QR_PREFONLY;
1220 er_flags &= ~QR_PREFONLY;
1223 if (!strcmp(bstr("readonly"), "yes")) {
1224 er_flags |= QR_READONLY;
1226 er_flags &= ~QR_READONLY;
1229 if (!strcmp(bstr("network"), "yes")) {
1230 er_flags |= QR_NETWORK;
1232 er_flags &= ~QR_NETWORK;
1235 if (!strcmp(bstr("directory"), "yes")) {
1236 er_flags |= QR_DIRECTORY;
1238 er_flags &= ~QR_DIRECTORY;
1241 if (!strcmp(bstr("ulallowed"), "yes")) {
1242 er_flags |= QR_UPLOAD;
1244 er_flags &= ~QR_UPLOAD;
1247 if (!strcmp(bstr("dlallowed"), "yes")) {
1248 er_flags |= QR_DOWNLOAD;
1250 er_flags &= ~QR_DOWNLOAD;
1253 if (!strcmp(bstr("visdir"), "yes")) {
1254 er_flags |= QR_VISDIR;
1256 er_flags &= ~QR_VISDIR;
1259 strcpy(buf, bstr("anon"));
1261 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
1262 if (!strcmp(buf, "anononly"))
1263 er_flags |= QR_ANONONLY;
1264 if (!strcmp(buf, "anon2"))
1265 er_flags |= QR_ANONOPT;
1268 if (!strcmp(bstr("bump"), "yes"))
1271 er_floor = atoi(bstr("er_floor"));
1273 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
1274 er_name, er_password, er_dirname, er_flags, bump, er_floor);
1277 if (buf[0] != '2') {
1278 display_error(&buf[4]);
1281 gotoroom(er_name, 0);
1283 if (strlen(er_roomaide) > 0) {
1284 sprintf(buf, "SETA %s", er_roomaide);
1287 if (buf[0] != '2') {
1288 display_error(&buf[4]);
1292 smart_goto(er_name);
1296 * Invite, Kick, and show Who Knows a room
1298 void display_whok(void)
1300 char buf[SIZ], room[SIZ], username[SIZ];
1305 if (buf[0] != '2') {
1306 display_error(&buf[4]);
1309 extract(room, &buf[4], 0);
1311 strcpy(username, bstr("username"));
1315 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>");
1316 wprintf("<SPAN CLASS=\"titlebar\">Access control list for ");
1317 escputs(WC->wc_roomname);
1318 wprintf("</SPAN></TD></TR></TABLE>\n");
1320 if(!strcmp(bstr("sc"), "Kick")) {
1321 sprintf(buf, "KICK %s", username);
1325 if (buf[0] != '2') {
1326 display_error(&buf[4]);
1329 wprintf("<B><I>User %s kicked out of room %s.</I></B>\n",
1332 } else if(!strcmp(bstr("sc"), "Invite")) {
1333 sprintf(buf, "INVT %s", username);
1337 if (buf[0] != '2') {
1338 display_error(&buf[4]);
1341 wprintf("<B><I>User %s invited to room %s.</I></B>\n",
1348 wprintf("<TABLE border=0 CELLSPACING=10><TR VALIGN=TOP>"
1349 "<TD>The users listed below have access to this room. "
1350 "To remove a user from the access list, select the user "
1351 "name from the list and click 'Kick'.<BR><BR>");
1353 wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
1354 wprintf("<SELECT NAME=\"username\" SIZE=10>\n");
1357 if (buf[0] == '1') {
1358 while (serv_gets(buf), strcmp(buf, "000")) {
1359 extract(username, buf, 0);
1360 wprintf("<OPTION>");
1365 wprintf("</SELECT><BR>\n");
1367 wprintf("<input type=submit name=sc value=\"Kick\">");
1368 wprintf("</FORM></CENTER>\n");
1371 "To grant another user access to this room, enter the "
1372 "user name in the box below and click 'Invite'.<BR><BR>");
1374 wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
1375 wprintf("Invite: ");
1376 wprintf("<input type=text name=username><BR>\n"
1377 "<input type=hidden name=sc value=\"Invite\">"
1378 "<input type=submit value=\"Invite\">"
1379 "</FORM></CENTER>\n");
1381 wprintf("</TD></TR></TABLE>\n");
1388 * display the form for entering a new room
1390 void display_entroom(void)
1395 serv_puts("CRE8 0");
1398 if (buf[0] != '2') {
1399 display_error(&buf[4]);
1404 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>");
1405 wprintf("<SPAN CLASS=\"titlebar\">Enter (create) a new room</SPAN>\n");
1406 wprintf("</TD></TR></TABLE>\n");
1408 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
1410 wprintf("<UL><LI>Name of room: ");
1411 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
1413 wprintf("<LI>Type of room:<UL>\n");
1415 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
1416 wprintf("CHECKED > Public room\n");
1418 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
1419 wprintf("> Private - guess name\n");
1421 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
1422 wprintf("> Private - require password:\n");
1423 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
1425 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
1426 wprintf("> Private - invitation only\n");
1429 wprintf("<LI>Resides on floor: ");
1431 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
1432 for (i = 0; i < 128; ++i)
1433 if (strlen(floorlist[i]) > 0) {
1434 wprintf("<OPTION ");
1435 wprintf("VALUE=\"%d\">", i);
1436 escputs(floorlist[i]);
1437 wprintf("</OPTION>\n");
1439 wprintf("</SELECT>\n");
1443 wprintf("<CENTER>\n");
1444 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1445 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1446 wprintf("</CENTER>\n");
1447 wprintf("</FORM>\n<HR>");
1448 serv_printf("MESG roomaccess");
1450 if (buf[0] == '1') {
1466 char er_password[10];
1470 if (strcmp(bstr("sc"), "OK")) {
1471 display_error("Cancelled. No new room was created.");
1474 strcpy(er_name, bstr("er_name"));
1475 strcpy(er_type, bstr("type"));
1476 strcpy(er_password, bstr("er_password"));
1477 er_floor = atoi(bstr("er_floor"));
1480 if (!strcmp(er_type, "guessname"))
1482 if (!strcmp(er_type, "passworded"))
1484 if (!strcmp(er_type, "invonly"))
1487 sprintf(buf, "CRE8 1|%s|%d|%s|%d",
1488 er_name, er_num_type, er_password, er_floor);
1491 if (buf[0] != '2') {
1492 display_error(&buf[4]);
1495 smart_goto(er_name);
1500 * display the screen to enter a private room
1502 void display_private(char *rname, int req_pass)
1507 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
1508 wprintf("<SPAN CLASS=\"titlebar\">Goto a private room</SPAN>\n");
1509 wprintf("</TD></TR></TABLE>\n");
1511 wprintf("<CENTER>\n");
1512 wprintf("If you know the name of a hidden (guess-name) or\n");
1513 wprintf("passworded room, you can enter that room by typing\n");
1514 wprintf("its name below. Once you gain access to a private\n");
1515 wprintf("room, it will appear in your regular room listings\n");
1516 wprintf("so you don't have to keep returning here.\n");
1517 wprintf("<BR><BR>");
1519 wprintf("<FORM METHOD=\"GET\" ACTION=\"/goto_private\">\n");
1521 wprintf("<TABLE border><TR><TD>");
1522 wprintf("Enter room name:</TD><TD>");
1523 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1526 wprintf("</TD></TR><TR><TD>");
1527 wprintf("Enter room password:</TD><TD>");
1528 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1530 wprintf("</TD></TR></TABLE>\n");
1532 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1533 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1534 wprintf("</FORM>\n");
1539 * goto a private room
1541 void goto_private(void)
1546 if (strcasecmp(bstr("sc"), "OK")) {
1547 display_main_menu();
1550 strcpy(hold_rm, WC->wc_roomname);
1551 strcpy(buf, "GOTO ");
1552 strcat(buf, bstr("gr_name"));
1554 strcat(buf, bstr("gr_pass"));
1558 if (buf[0] == '2') {
1559 smart_goto(bstr("gr_name"));
1562 if (!strncmp(buf, "540", 3)) {
1563 display_private(bstr("gr_name"), 1);
1567 wprintf("%s\n", &buf[4]);
1574 * display the screen to zap a room
1576 void display_zap(void)
1580 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
1581 wprintf("<SPAN CLASS=\"titlebar\">Zap (forget) the current room</SPAN>\n");
1582 wprintf("</TD></TR></TABLE>\n");
1584 wprintf("If you select this option, <em>%s</em> will ", WC->wc_roomname);
1585 wprintf("disappear from your room list. Is this what you wish ");
1586 wprintf("to do?<BR>\n");
1588 wprintf("<FORM METHOD=\"GET\" ACTION=\"/zap\">\n");
1589 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1590 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1591 wprintf("</FORM>\n");
1602 char final_destination[SIZ];
1604 /* If the forget-room routine fails for any reason, we fall back
1605 * to the current room; otherwise, we go to the Lobby
1607 strcpy(final_destination, WC->wc_roomname);
1609 if (!strcasecmp(bstr("sc"), "OK")) {
1610 serv_printf("GOTO %s", WC->wc_roomname);
1612 if (buf[0] != '2') {
1613 /* ExpressMessageCat(&buf[4]); */
1617 if (buf[0] != '2') {
1618 /* ExpressMessageCat(&buf[4]); */
1620 strcpy(final_destination, "_BASEROOM_");
1624 smart_goto(final_destination);
1631 * Confirm deletion of the current room
1633 void confirm_delete_room(void)
1637 serv_puts("KILL 0");
1639 if (buf[0] != '2') {
1640 display_error(&buf[4]);
1644 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
1645 wprintf("<SPAN CLASS=\"titlebar\">Confirm deletion of room</SPAN>\n");
1646 wprintf("</TD></TR></TABLE>\n");
1648 wprintf("<CENTER>");
1649 wprintf("<FORM METHOD=\"GET\" ACTION=\"/delete_room\">\n");
1651 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1652 escputs(WC->wc_roomname);
1653 wprintf("</FONT>?<BR>\n");
1655 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1656 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1658 wprintf("</FORM></CENTER>\n");
1664 * Delete the current room
1666 void delete_room(void)
1671 strcpy(sc, bstr("sc"));
1673 if (strcasecmp(sc, "Delete")) {
1674 display_error("Cancelled. This room was not deleted.");
1677 serv_puts("KILL 1");
1679 if (buf[0] != '2') {
1680 display_error(&buf[4]);
1682 smart_goto("_BASEROOM_");
1689 * Perform changes to a room's network configuration
1691 void netedit(void) {
1696 if (strlen(bstr("line"))==0) {
1701 strcpy(line, bstr("prefix"));
1702 strcat(line, bstr("line"));
1703 strcat(line, bstr("suffix"));
1713 if (buf[0] != '1') {
1719 /* This loop works for add *or* remove. Spiffy, eh? */
1720 while (serv_gets(buf), strcmp(buf, "000")) {
1721 if (strcasecmp(buf, line)) {
1722 fprintf(fp, "%s\n", buf);
1729 if (buf[0] != '4') {
1735 while (fgets(buf, sizeof buf, fp) != NULL) {
1736 buf[strlen(buf)-1] = 0;
1740 if (!strcasecmp(bstr("cmd"), "add")) {
1752 * Convert a room name to a folder-ish-looking name.
1754 void room_to_folder(char *folder, char *room, int floor, int is_mailbox)
1759 * For mailboxes, just do it straight...
1762 sprintf(folder, "My folders|%s", room);
1766 * Otherwise, prefix the floor name as a "public folders" moniker
1769 sprintf(folder, "%s|%s", floorlist[floor], room);
1773 * Replace "/" characters with "|" for pseudo-folder-delimiting
1775 for (i=0; i<strlen(folder); ++i) {
1776 if (folder[i] == '/') folder[i] = '|';
1787 * Change the view for this room
1789 void change_view(void) {
1793 view = atol(bstr("view"));
1795 serv_printf("VIEW %d", view);
1797 smart_goto(WC->wc_roomname);
1802 * Show the room list in "folders" format. (only should get called by
1803 * knrooms() because that's where output_headers() is called from)
1805 void folders(void) {
1808 int levels, oldlevels;
1819 struct folder *fold = NULL;
1821 int max_folders = 0;
1822 int alloc_folders = 0;
1829 /* Start with the mailboxes */
1832 fold = malloc(sizeof(struct folder));
1833 memset(fold, 0, sizeof(struct folder));
1834 strcpy(fold[0].name, "My folders");
1835 fold[0].is_mailbox = 1;
1837 /* Then add floors */
1840 if (buf[0]=='1') while(serv_gets(buf), strcmp(buf, "000")) {
1841 if (max_folders >= alloc_folders) {
1842 alloc_folders = max_folders + 100;
1843 fold = realloc(fold,
1844 alloc_folders * sizeof(struct folder));
1846 memset(&fold[max_folders], 0, sizeof(struct folder));
1847 extract(fold[max_folders].name, buf, 1);
1854 if (buf[0]=='1') while(serv_gets(buf), strcmp(buf, "000")) {
1855 if (max_folders >= alloc_folders) {
1856 alloc_folders = max_folders + 100;
1857 fold = realloc(fold,
1858 alloc_folders * sizeof(struct folder));
1860 memset(&fold[max_folders], 0, sizeof(struct folder));
1861 extract(fold[max_folders].room, buf, 0);
1862 ra_flags = extract_int(buf, 5);
1863 flags = extract_int(buf, 1);
1864 floor = extract_int(buf, 2);
1865 fold[max_folders].hasnewmsgs =
1866 ((ra_flags & UA_HASNEWMSGS) ? 1 : 0 );
1867 if (flags & QR_MAILBOX) {
1868 fold[max_folders].is_mailbox = 1;
1870 room_to_folder(fold[max_folders].name,
1871 fold[max_folders].room,
1873 fold[max_folders].is_mailbox);
1874 fold[max_folders].selectable = 1;
1878 /* Bubble-sort the folder list */
1879 for (i=0; i<max_folders; ++i) {
1880 for (j=0; j<(max_folders-1)-i; ++j) {
1881 if (fold[j].is_mailbox == fold[j+1].is_mailbox) {
1882 swap = strcasecmp(fold[j].name, fold[j+1].name);
1885 if ( (fold[j+1].is_mailbox)
1886 && (!fold[j].is_mailbox)) {
1894 memcpy(&ftmp, &fold[j], sizeof(struct folder));
1895 memcpy(&fold[j], &fold[j+1],
1896 sizeof(struct folder));
1897 memcpy(&fold[j+1], &ftmp,
1898 sizeof(struct folder));
1907 for (i=0; i<max_folders; ++i) {
1909 levels = num_tokens(fold[i].name, '|');
1910 if (levels > oldlevels) {
1911 for (k=0; k<(levels-oldlevels); ++k) {
1915 if (levels < oldlevels) {
1916 for (k=0; k<(oldlevels-levels); ++k) {
1922 for (t=0; t<nests; ++t) wprintf(" ");
1923 if (fold[i].selectable) {
1924 wprintf("<A HREF=\"/dotgoto?room=");
1925 urlescputs(fold[i].room);
1931 if (fold[i].hasnewmsgs) wprintf("<B>");
1932 extract(buf, fold[i].name, levels-1);
1934 if (fold[i].hasnewmsgs) wprintf("</B>");
1935 if (fold[i].selectable) {
1941 if (!strcasecmp(fold[i].name, "My Folders|Mail")) {
1942 wprintf(" (INBOX)");
1946 while (nests-- > 0) ;;
1953 /* Do either a known rooms list or a folders list, depending on the
1957 char listviewpref[SIZ];
1962 /* Determine whether the user is trying to change views */
1963 if (bstr("view") != NULL) {
1964 if (strlen(bstr("view")) > 0) {
1965 set_preference("roomlistview", bstr("view"));
1969 get_preference("roomlistview", listviewpref);
1971 if (strcasecmp(listviewpref, "folders")) {
1972 strcpy(listviewpref, "rooms");
1976 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>"
1977 "<SPAN CLASS=\"titlebar\">"
1979 if (!strcasecmp(listviewpref, "rooms")) {
1980 wprintf("Room list");
1982 if (!strcasecmp(listviewpref, "folders")) {
1983 wprintf("Folder list");
1985 wprintf("</SPAN></TD>\n");
1988 /* offer the ability to switch views */
1989 wprintf("<TD><FORM NAME=\"roomlistomatic\">\n"
1990 "<SELECT NAME=\"newview\" SIZE=\"1\" "
1991 "OnChange=\"location.href=roomlistomatic.newview.options"
1992 "[selectedIndex].value\">\n");
1994 wprintf("<OPTION %s VALUE=\"/knrooms&view=rooms\">"
1997 ( !strcasecmp(listviewpref, "rooms") ? "SELECTED" : "" )
2000 wprintf("<OPTION %s VALUE=\"/knrooms&view=folders\">"
2001 "View as folder list"
2003 ( !strcasecmp(listviewpref, "folders") ? "SELECTED" : "" )
2006 wprintf("</SELECT></FORM></TD><TD>\n");
2008 wprintf("</TD></TR></TABLE><BR>\n");
2010 /* Display the room list in the user's preferred format */
2011 if (!strcasecmp(listviewpref, "folders")) {
2015 list_all_rooms_by_floor();