"Summary",
"Address Book",
"Calendar",
- "Tasks"
+ "Tasks",
+ "Notes"
};
char floorlist[128][SIZ];
urlescputs(rmname);
wprintf("\"");
wprintf(">");
- escputs1(rmname, 1);
+ escputs1(rmname, 1, 1);
if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
wprintf("}");
else if (f & QR_DIRECTORY)
}
-/*
- * list all rooms by floor (only should get called from knrooms() because
- * that's where output_headers() is called from)
- */
-void tabular_room_list(void)
-{
- int a;
- char buf[SIZ];
-
- do_template("beginbox_nt");
- wprintf("<TABLE width=100%% border><TR><TH>Floor</TH>");
- wprintf("<TH>Rooms with new messages</TH>");
- wprintf("<TH>Rooms with no new messages</TH></TR>\n");
-
- for (a = 0; a < 128; ++a)
- if (floorlist[a][0] != 0) {
-
- /* Floor name column */
- wprintf("<TR><TD>");
-
- serv_printf("OIMG _floorpic_|%d", a);
- serv_gets(buf);
- if (buf[0] == '2') {
- serv_puts("CLOS");
- serv_gets(buf);
- wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
- a, &floorlist[a][0]);
- } else {
- escputs(&floorlist[a][0]);
- }
-
- wprintf("</TD>");
-
- /* Rooms with new messages column */
- wprintf("<TD>");
- sprintf(buf, "LKRN %d", a);
- listrms(buf);
- wprintf("</TD>\n<TD>");
-
- /* Rooms with old messages column */
- sprintf(buf, "LKRO %d", a);
- listrms(buf);
- wprintf("</TD></TR>\n");
- }
- wprintf("</TABLE>\n");
- do_template("endbox");
- wDumpContent(1);
-}
-
-
-
-
-
-
-
-
-
/*
* list all forgotten rooms
*/
/*
- * generic routine to take the session to a new room
+ * back end routine to take the session to a new room
*
- * display_name values: 0 = goto only
- * 1 = goto and display
- * 2 = display only
*/
-void gotoroom(char *gname, int display_name)
+void gotoroom(char *gname)
{
char buf[SIZ];
static long ls = (-1L);
+ /* store ungoto information */
+ strcpy(WC->ugname, WC->wc_roomname);
+ WC->uglsn = ls;
- if (display_name) {
- output_headers(0);
- wprintf("Pragma: no-cache\n");
- wprintf("Cache-Control: no-store\n");
-
- wprintf("<HTML><HEAD>\n"
- "<META HTTP-EQUIV=\"refresh\" CONTENT=\"500363689;\">\n"
- "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
- "<META HTTP-EQUIV=\"expired\" CONTENT=\"28-May-1971 18:10:00 GMT\">\n"
- "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\">\n"
- "</HEAD>\n");
- do_template("background");
- }
- if (display_name != 2) {
- /* store ungoto information */
- strcpy(WC->ugname, WC->wc_roomname);
- WC->uglsn = ls;
- }
/* move to the new room */
serv_printf("GOTO %s", gname);
serv_gets(buf);
serv_gets(buf);
}
if (buf[0] != '2') {
- if (display_name) {
- wprintf("<EM>%s</EM><BR>\n", &buf[4]);
- wDumpContent(1);
- }
return;
}
extract(WC->wc_roomname, &buf[4], 0);
maxmsgnum = extract_int(&buf[4],5);
is_mail = (char) extract_int(&buf[4],7); */
ls = extract_long(&buf[4], 6);
+ WC->wc_floor = extract_int(&buf[4], 10);
+ WC->wc_view = extract_int(&buf[4], 11);
+ WC->wc_default_view = extract_int(&buf[4], 12);
if (WC->is_aide)
WC->is_room_aide = WC->is_aide;
remove_march(WC->wc_roomname);
if (!strcasecmp(gname, "_BASEROOM_"))
remove_march(gname);
-
- /* Display the room banner */
- if (display_name) {
- embed_room_banner(buf);
- wDumpContent(1);
- }
- strcpy(WC->wc_roomname, WC->wc_roomname);
- WC->wc_view = extract_int(&buf[4], 11);
- WC->wc_default_view = extract_int(&buf[4], 12);
}
void smart_goto(char *next_room) {
- gotoroom(next_room, 0);
+ gotoroom(next_room);
readloop("readnew");
}
char *tab;
char *shared_with;
char *not_shared_with;
+ int roompolicy = 0;
+ int roomvalue = 0;
+ int floorpolicy = 0;
+ int floorvalue = 0;
tab = bstr("tab");
if (strlen(tab) == 0) tab = "admin";
+ load_floorlist();
serv_puts("GETR");
serv_gets(buf);
output_headers(1);
/* print the tabbed dialog */
- wprintf("<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
+ wprintf("<BR><TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
"<TR ALIGN=CENTER>"
"<TD> </TD>\n");
wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
}
else {
- wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=admin\">");
+ wprintf("<TD BGCOLOR=\"#CCCCCC\"><A HREF=\"/display_editroom&tab=admin\">");
}
- wprintf("Room administration");
+ wprintf("Administration");
if (!strcmp(tab, "admin")) {
wprintf("</SPAN></TD>\n");
}
wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
}
else {
- wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=config\">");
+ wprintf("<TD BGCOLOR=\"#CCCCCC\"><A HREF=\"/display_editroom&tab=config\">");
}
- wprintf("Room configuration");
+ wprintf("Configuration");
if (!strcmp(tab, "config")) {
wprintf("</SPAN></TD>\n");
}
wprintf("<TD> </TD>\n");
+ if (!strcmp(tab, "expire")) {
+ wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+ }
+ else {
+ wprintf("<TD BGCOLOR=\"#CCCCCC\"><A HREF=\"/display_editroom&tab=expire\">");
+ }
+ wprintf("Message expire policy");
+ if (!strcmp(tab, "expire")) {
+ wprintf("</SPAN></TD>\n");
+ }
+ else {
+ wprintf("</A></TD>\n");
+ }
+
+ wprintf("<TD> </TD>\n");
+
if (!strcmp(tab, "sharing")) {
wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
}
else {
- wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=sharing\">");
+ wprintf("<TD BGCOLOR=\"#CCCCCC\"><A HREF=\"/display_editroom&tab=sharing\">");
}
wprintf("Sharing");
if (!strcmp(tab, "sharing")) {
wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
}
else {
- wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=listserv\">");
+ wprintf("<TD BGCOLOR=\"#CCCCCC\"><A HREF=\"/display_editroom&tab=listserv\">");
}
wprintf("Mailing list service");
if (!strcmp(tab, "listserv")) {
wprintf("</A></TD>\n");
}
+ wprintf("<TD> </TD>\n");
+
wprintf("</TR></TABLE>\n");
/* end tabbed dialog */
wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
wprintf("<LI>Resides on floor: ");
- load_floorlist();
wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
for (i = 0; i < 128; ++i)
if (strlen(floorlist[i]) > 0) {
wprintf("CHECKED ");
wprintf("> Network shared room\n");
+ wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"permanent\" VALUE=\"yes\" ");
+ if (er_flags & QR_PERMANENT)
+ wprintf("CHECKED ");
+ wprintf("> Permanent (does not auto-purge)\n");
+
/* start of anon options */
wprintf("<LI>Anonymous messages<UL>\n");
}
wprintf("</UL><CENTER>\n");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
- wprintf("</CENTER>\n");
+ wprintf("<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"config\">\n"
+ "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">"
+ " "
+ "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">"
+ "</CENTER>\n"
+ );
}
wprintf("</CENTER>\n");
}
+
+ /* Mailing list management */
+ if (!strcmp(tab, "expire")) {
+
+ serv_puts("GPEX room");
+ serv_gets(buf);
+ if (buf[0] == '2') {
+ roompolicy = extract_int(&buf[4], 0);
+ roomvalue = extract_int(&buf[4], 1);
+ }
+
+ serv_puts("GPEX floor");
+ serv_gets(buf);
+ if (buf[0] == '2') {
+ floorpolicy = extract_int(&buf[4], 0);
+ floorvalue = extract_int(&buf[4], 1);
+ }
+
+ wprintf("<BR><FORM METHOD=\"POST\" ACTION=\"/set_room_policy\">\n");
+ wprintf("<TABLE border=0 cellspacing=5>\n");
+ wprintf("<TR><TD>Message expire policy for this room<BR>(");
+ escputs(WC->wc_roomname);
+ wprintf(")</TD><TD>");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"roompolicy\" VALUE=\"0\" %s>",
+ ((roompolicy == 0) ? "CHECKED" : "") );
+ wprintf("Use the default policy for this floor<BR>\n");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"roompolicy\" VALUE=\"1\" %s>",
+ ((roompolicy == 1) ? "CHECKED" : "") );
+ wprintf("Never automatically expire messages<BR>\n");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"roompolicy\" VALUE=\"2\" %s>",
+ ((roompolicy == 2) ? "CHECKED" : "") );
+ wprintf("Expire by message count<BR>\n");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"roompolicy\" VALUE=\"3\" %s>",
+ ((roompolicy == 3) ? "CHECKED" : "") );
+ wprintf("Expire by message age<BR>");
+ wprintf("Number of messages or days: ");
+ wprintf("<INPUT TYPE=\"text\" NAME=\"roomvalue\" MAXLENGTH=\"5\" VALUE=\"%d\">", roomvalue);
+ wprintf("</TD></TR>\n");
+
+ if (WC->axlevel >= 6) {
+ wprintf("<TR><TD COLSPAN=2><HR></TD></TR>\n");
+ wprintf("<TR><TD>Message expire policy for this floor<BR>(");
+ escputs(floorlist[WC->wc_floor]);
+ wprintf(")</TD><TD>");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"floorpolicy\" VALUE=\"0\" %s>",
+ ((floorpolicy == 0) ? "CHECKED" : "") );
+ wprintf("Use the system default<BR>\n");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"floorpolicy\" VALUE=\"1\" %s>",
+ ((floorpolicy == 1) ? "CHECKED" : "") );
+ wprintf("Never automatically expire messages<BR>\n");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"floorpolicy\" VALUE=\"2\" %s>",
+ ((floorpolicy == 2) ? "CHECKED" : "") );
+ wprintf("Expire by message count<BR>\n");
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"floorpolicy\" VALUE=\"3\" %s>",
+ ((floorpolicy == 3) ? "CHECKED" : "") );
+ wprintf("Expire by message age<BR>");
+ wprintf("Number of messages or days: ");
+ wprintf("<INPUT TYPE=\"text\" NAME=\"floorvalue\" MAXLENGTH=\"5\" VALUE=\"%d\">",
+ floorvalue);
+ }
+
+ wprintf("<CENTER>\n");
+ wprintf("<TR><TD COLSPAN=2><HR><CENTER>\n");
+ wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
+ wprintf(" ");
+ wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
+ wprintf("</CENTER></TD><TR>\n");
+
+ wprintf("</TABLE>\n"
+ "<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"expire\">\n"
+ "</FORM>\n"
+ );
+
+ }
+
+
/* end content of whatever tab is open now */
wprintf("</TD></TR></TABLE>\n");
if (strcmp(bstr("sc"), "OK")) {
strcpy(WC->ImportantMessage,
"Cancelled. Changes were not saved.");
- display_main_menu();
+ display_editroom();
return;
}
serv_puts("GETR");
if (buf[0] != '2') {
strcpy(WC->ImportantMessage, &buf[4]);
- display_main_menu();
+ display_editroom();
return;
}
extract(er_name, &buf[4], 0);
er_flags &= ~QR_READONLY;
}
+ if (!strcmp(bstr("permanent"), "yes")) {
+ er_flags |= QR_PERMANENT;
+ } else {
+ er_flags &= ~QR_PERMANENT;
+ }
+
if (!strcmp(bstr("network"), "yes")) {
er_flags |= QR_NETWORK;
} else {
serv_gets(buf);
if (buf[0] != '2') {
strcpy(WC->ImportantMessage, &buf[4]);
- display_main_menu();
+ display_editroom();
return;
}
- gotoroom(er_name, 0);
+ gotoroom(er_name);
if (strlen(er_roomaide) > 0) {
sprintf(buf, "SETA %s", er_roomaide);
return;
}
}
- smart_goto(er_name);
+ gotoroom(er_name);
+ strcpy(WC->ImportantMessage, "Your changes have been saved.");
+ display_editroom();
+ return;
}
/*
}
output_headers(1);
- stresc(buf, WC->wc_roomname, 1);
+ stresc(buf, WC->wc_roomname, 1, 1);
svprintf("BOXTITLE", WCS_STRING, "Access control list for %s", buf);
do_template("beginbox");
wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
wprintf("<UL><LI>Name of room: ");
- wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
+ wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"127\">\n");
wprintf("<LI>Resides on floor: ");
load_floorlist();
wprintf("<CENTER>\n");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
+ wprintf(" ");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
wprintf("</CENTER>\n");
wprintf("</FORM>\n<HR>");
void entroom(void)
{
char buf[SIZ];
- char er_name[20];
- char er_type[20];
- char er_password[10];
+ char er_name[SIZ];
+ char er_type[SIZ];
+ char er_password[SIZ];
int er_floor;
int er_num_type;
+ int er_view;
if (strcmp(bstr("sc"), "OK")) {
strcpy(WC->ImportantMessage,
strcpy(er_type, bstr("type"));
strcpy(er_password, bstr("er_password"));
er_floor = atoi(bstr("er_floor"));
+ er_view = atoi(bstr("er_view"));
er_num_type = 0;
if (!strcmp(er_type, "guessname"))
if (!strcmp(er_type, "personal"))
er_num_type = 4;
- sprintf(buf, "CRE8 1|%s|%d|%s|%d",
- er_name, er_num_type, er_password, er_floor);
+ sprintf(buf, "CRE8 1|%s|%d|%s|%d|%d|%d",
+ er_name, er_num_type, er_password, er_floor, 0, er_view);
serv_puts(buf);
serv_gets(buf);
if (buf[0] != '2') {
display_main_menu();
return;
}
- gotoroom(er_name, 0);
- er_set_default_view(atoi(bstr("er_view")));
- smart_goto(er_name);
+ gotoroom(er_name);
+ do_change_view(er_view); /* Now go there */
}
wprintf("<FORM METHOD=\"GET\" ACTION=\"/zap\">\n");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
+ wprintf(" ");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
wprintf("</FORM>\n");
wDumpContent(1);
+/*
+ * Back end for change_view()
+ */
+void do_change_view(int newview) {
+ char buf[SIZ];
+
+ serv_printf("VIEW %d", newview);
+ serv_gets(buf);
+ WC->wc_view = newview;
+ smart_goto(WC->wc_roomname);
+}
*/
void change_view(void) {
int view;
- char buf[SIZ];
view = atol(bstr("view"));
-
- serv_printf("VIEW %d", view);
- serv_gets(buf);
- smart_goto(WC->wc_roomname);
+ do_change_view(view);
}
char buf[SIZ];
int levels, oldlevels;
int i, t;
+ int actnum = 0;
+ int has_subfolders = 0;
+
+ /* Include the menu expanding/collapsing code */
+ wprintf("<script type=\"text/javascript\" src=\"/static/menuExpandable3.js\"></script>\n");
do_template("beginbox_nt");
+ wprintf("<div id=\"mainMenu\">\n");
+ wprintf("<UL id=\"menuList\">\n");
levels = 0;
oldlevels = 0;
+
for (i=0; i<max_folders; ++i) {
+ has_subfolders = 0;
+ if ((i+1) < max_folders) {
+ if ( (!strncasecmp(fold[i].name, fold[i+1].name, strlen(fold[i].name)))
+ && (fold[i+1].name[strlen(fold[i].name)] == '|') ) {
+ has_subfolders = 1;
+ }
+ }
+
levels = num_tokens(fold[i].name, '|');
- oldlevels = levels;
- for (t=0; t<levels; ++t) wprintf(" ");
+ if ( (levels < oldlevels) || ((levels==1)&&(i!=0)) ) {
+ for (t=0; t<(oldlevels-levels); ++t) {
+ wprintf("</UL>\n");
+ }
+ }
+
+ if (has_subfolders) {
+ wprintf("<LI");
+ if (levels == 1) wprintf(" class=\"menubar\"");
+ wprintf(">");
+ wprintf("<A href=\"#\" id=\"actuator%d\" class=\"actuator\"></a>\n", actnum);
+ }
+ else {
+ wprintf("<LI>");
+ }
+
if (fold[i].selectable) {
wprintf("<A HREF=\"/dotgoto?room=");
urlescputs(fold[i].room);
wprintf("\">");
}
- else {
- wprintf("<i>");
+
+ if (levels == 1) {
+ wprintf("<SPAN CLASS=\"roomlist_floor\">");
}
- if (fold[i].hasnewmsgs) {
+ else if (fold[i].hasnewmsgs) {
wprintf("<SPAN CLASS=\"roomlist_new\">");
}
else {
extract(buf, fold[i].name, levels-1);
escputs(buf);
wprintf("</SPAN>");
+
+ if (!strcasecmp(fold[i].name, "My Folders|Mail")) {
+ wprintf(" (INBOX)");
+ }
+
if (fold[i].selectable) {
wprintf("</A>");
}
- else {
- wprintf("</i>");
- }
- if (!strcasecmp(fold[i].name, "My Folders|Mail")) {
- wprintf(" (INBOX)");
+ wprintf("\n");
+
+ if (has_subfolders) {
+ wprintf("<UL id=\"menu%d\" class=\"%s\">\n",
+ actnum++,
+ ( (levels == 1) ? "menu" : "submenu")
+ );
}
- wprintf("<BR>\n");
+
+ oldlevels = levels;
}
+ wprintf("</UL></UL>\n");
+ wprintf("<img src=\"/static/blank.gif\" onLoad = ' \n");
+ for (i=0; i<actnum; ++i) {
+ wprintf(" initializeMenu(\"menu%d\", \"actuator%d\");\n", i, i);
+ }
+ wprintf(" ' > \n");
+ wprintf("</DIV>\n");
do_template("endbox");
}
levels = num_tokens(fold[i].name, '|');
- if ((levels == 1) && (oldlevels == 2)) {
+ if ((levels == 1) && (oldlevels > 1)) {
/* End inner box */
do_template("endbox");
/* Begin inner box */
extract(buf, fold[i].name, levels-1);
- stresc(boxtitle, buf, 1);
+ stresc(boxtitle, buf, 1, 0);
svprintf("BOXTITLE", WCS_STRING, boxtitle);
do_template("beginbox");
}
/* title bar */
- wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>"
+ wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
"<SPAN CLASS=\"titlebar\">"
);
if (!strcasecmp(listviewpref, "rooms")) {
/* offer the ability to switch views */
- wprintf("<TD><FORM NAME=\"roomlistomatic\">\n"
+ wprintf("<TD ALIGN=RIGHT><FORM NAME=\"roomlistomatic\">\n"
"<SELECT NAME=\"newview\" SIZE=\"1\" "
"OnChange=\"location.href=roomlistomatic.newview.options"
"[selectedIndex].value\">\n");
( !strcasecmp(listviewpref, "folders") ? "SELECTED" : "" )
);
- wprintf("<OPTION %s VALUE=\"/knrooms&view=table\">"
- "Classic table view"
- "</OPTION>\n",
- ( !strcasecmp(listviewpref, "table") ? "SELECTED" : "" )
- );
-
- wprintf("</SELECT></FORM></TD><TD>\n");
+ wprintf("</SELECT><BR>");
offer_start_page();
- wprintf("</TD></TR></TABLE>\n");
+ wprintf("</FORM></TD></TR></TABLE>\n");
/* Display the room list in the user's preferred format */
- if (!strcasecmp(listviewpref, "table")) {
- tabular_room_list();
+ list_all_rooms_by_floor(listviewpref);
+}
+
+
+
+/*
+ * Set the message expire policy for this room and/or floor
+ */
+void set_room_policy(void) {
+ char buf[SIZ];
+
+ if (strcmp(bstr("sc"), "OK")) {
+ strcpy(WC->ImportantMessage,
+ "Cancelled. Changes were not saved.");
+ display_editroom();
+ return;
}
- else {
- list_all_rooms_by_floor(listviewpref);
+
+ serv_printf("SPEX room|%d|%d", atoi(bstr("roompolicy")), atoi(bstr("roomvalue")));
+ serv_gets(buf);
+ strcpy(WC->ImportantMessage, &buf[4]);
+
+ if (WC->axlevel >= 6) {
+ strcat(WC->ImportantMessage, "<BR>\n");
+ serv_printf("SPEX floor|%d|%d", atoi(bstr("floorpolicy")), atoi(bstr("floorvalue")));
+ serv_gets(buf);
+ strcat(WC->ImportantMessage, &buf[4]);
}
+
+ display_editroom();
}