$Log$
+Revision 602.4 2005/02/18 05:09:52 ajc
+* Moved the room access control screen into a tab on the edit room menu
+
Revision 602.3 2005/02/17 04:48:26 ajc
* After setup is complete, tell them how to log in.
* Don't allow the creation of accounts with blank passwords.
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
fmout(NULL, "CENTER");
}
- wprintf("<form name=\"changepwform\" action=\"changepw\" method=\"post\" onLoad=\"document.changepwform.action.disabled = true\">\n");
+ wprintf("<form name=\"changepwform\" action=\"changepw\" method=\"post\">\n");
wprintf("<CENTER>"
"<table border=\"0\" cellspacing=\"5\" cellpadding=\"5\" "
"BGCOLOR=\"#EEEEEE\">"
int ib_users = 1; /* Users icon */
int ib_chat = 1; /* Chat icon */
int ib_advanced = 1; /* Advanced Options icon */
- int ib_logoff = 1; /* Logoff button */
int ib_citadel = 1; /* 'Powered by Citadel' logo */
/*
*/
if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
- if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
}
wprintf("</A></li>\n");
}
- if (ib_logoff) {
+ if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
+ wprintf("<li>"
+ "<A HREF=\"/display_aide_menu\" "
+ "TITLE=\"Room and system administration functions\" "
+ ">"
+ );
+ if (ib_displayas != IB_TEXTONLY) {
+ wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
+ "SRC=\"/static/advanced-icon.gif\">");
+ }
+ if (ib_displayas != IB_PICONLY) {
+ wprintf("Administration");
+ }
+ wprintf("</A></li>\n");
+ }
+
+ if (1) {
wprintf("<li>"
"<A HREF=\"/termquit\" TITLE=\"Log off\" "
"onClick=\"return confirm('Log off now?');\">"
char buf[SIZ];
char key[SIZ], value[SIZ];
int i;
+ int bar = 0;
/* The initialized values of these variables also happen to
* specify the default values for users who haven't customized
int ib_users = 1; /* Users icon */
int ib_chat = 1; /* Chat icon */
int ib_advanced = 1; /* Advanced Options icon */
- int ib_logoff = 1; /* Logoff button */
int ib_citadel = 1; /* 'Powered by Citadel' logo */
/*
*/
if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
- if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
}
wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
- wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+ wprintf("<TR BGCOLOR=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
"</TD><TD>"
"<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
"<B>Site logo</B><br />"
"A graphic describing this site"
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_logo ? "CHECKED" : "")
);
- wprintf("<TR><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
"</TD><TD>"
"<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
"<B>Summary</B><br />"
"Your summary page"
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_summary ? "CHECKED" : "")
);
- wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
"</TD><TD>"
"<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
"<B>Mail (inbox)</B><br />"
"A shortcut to your e-mail Inbox."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_inbox ? "CHECKED" : "")
);
- wprintf("<TR><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
"VALUE=\"yes\" %s>"
"</TD><TD>"
"<B>Contacts</B><br />"
"Your personal address book."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_contacts ? "CHECKED" : "")
);
- wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_notes\" "
"VALUE=\"yes\" %s>"
"</TD><TD>"
"<B>Notes</B><br />"
"Your personal notes."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_notes ? "CHECKED" : "")
);
#ifdef WEBCIT_WITH_CALENDAR_SERVICE
- wprintf("<TR><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
"VALUE=\"yes\" %s>"
"</TD><TD>"
"<B>Calendar</B><br />"
"A shortcut to your personal calendar."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_calendar ? "CHECKED" : "")
);
- wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
"</TD><TD>"
"<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
"<B>Tasks</B><br />"
"A shortcut to your personal task list."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_tasks ? "CHECKED" : "")
);
#endif /* WEBCIT_WITH_CALENDAR_SERVICE */
- wprintf("<TR><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
"</TD><TD>"
"<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
"Clicking this icon displays a list of all accesible "
"rooms (or folders) available."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_rooms ? "CHECKED" : "")
);
- wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
"</TD><TD>"
"<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
"Clicking this icon displays a list of all users "
"currently logged in."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_users ? "CHECKED" : "")
);
- wprintf("<TR><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
"</TD><TD>"
"<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
"Clicking this icon enters real-time chat mode "
"with other users in the same room."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_chat ? "CHECKED" : "")
);
- wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
"VALUE=\"yes\" %s>"
"</TD><TD>"
"<B>Advanced options</B><br />"
"Access to the complete menu of Citadel functions."
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_advanced ? "CHECKED" : "")
);
- wprintf("<TR><TD>"
- "<INPUT TYPE=\"checkbox\" NAME=\"ib_logoff\" "
- "VALUE=\"yes\" %s>"
- "</TD><TD>"
- "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
- "SRC=\"/static/exit-icon.gif\" ALT=\" \">"
- "</TD><TD>"
- "<B>Log off</B><br />"
- "Exit from the Citadel system. If you remove this icon "
- "then you will have no way out!"
- "</TD></TR>\n",
- (ib_logoff ? "CHECKED" : "")
- );
- wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
+ wprintf("<TR bgcolor=%s><TD>"
"<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
"VALUE=\"yes\" %s>"
"</TD><TD>"
"<B>Citadel logo</B><br />"
"Displays the "Powered by Citadel" graphic"
"</TD></TR>\n",
+ ((bar = 1 - bar), (bar ? "\"#CCCCCC\"" : "\"#FFFFFF\"")),
(ib_citadel ? "CHECKED" : "")
);
wprintf("</TD></TR>"
"<TR VALIGN=TOP><TD>");
- svprintf("BOXTITLE", WCS_STRING, "Interaction");
- do_template("beginbox");
-
- wprintf("<A HREF=\"/whobbs\">"
- "<span class=\"mainmenu\">"
- "Who is online now?</span></A><br />\n"
- );
-
- wprintf("<A HREF=\"#\" onClick=\"window.open('/chat', "
- "'ctdl_chat_window', "
- "'toolbar=no,location=no,directories=no,copyhistory=no,"
- "status=no,scrollbars=yes,resizable=yes');\""
- ">"
- "<span class=\"mainmenu\">"
- "Chat with other users in <i>"
- );
- escputs(WC->wc_roomname);
- wprintf("</i></span></A><br />\n");
-
- wprintf("<A HREF=\"/display_generic\">\n");
- wprintf("<span class=\"mainmenu\">"
- "Generic server command</span></A>\n");
-
- do_template("endbox");
-
- wprintf("</TD><TD>");
-
svprintf("BOXTITLE", WCS_STRING, "Your info");
do_template("beginbox");
do_template("endbox");
- wprintf("</TD></TR><TR VALIGN=TOP><TD>");
+ wprintf("</TD><TD>");
svprintf("BOXTITLE", WCS_STRING, "Advanced room commands");
do_template("beginbox");
"Zap (forget) this room (%s)</span></A><br />\n",
WC->wc_roomname);
- wprintf("<A HREF=\"/display_whok\">\n"
- "<span class=\"mainmenu\">"
- "Access controls for this room</span></A><br />\n");
-
wprintf("<A HREF=\"/zapped_list\">"
"<span class=\"mainmenu\">"
"List all forgotten rooms</span></A>\n");
do_template("endbox");
- wprintf("</TD><TD>");
+ wprintf("</td></tr></table></center>");
+ wDumpContent(2);
+}
- if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
- svprintf("BOXTITLE", WCS_STRING, "Administrative functions");
- do_template("beginbox");
- wprintf("<A HREF=\"/display_siteconfig\">"
- "<span class=\"mainmenu\">"
- "Edit site-wide configuration</span></A>\n");
-
- if (WC->axlevel >= 6) {
- wprintf("<br />"
- "<A HREF=\"/select_user_to_edit\">"
- "<span class=\"mainmenu\">"
- "Add, change, delete user accounts"
- "</span></A><br />\n");
-
- wprintf("<A HREF=\"/validate\">"
- "<span class=\"mainmenu\">"
- "Validate new users</span></A><br />\n");
-
- wprintf("<A HREF=\"/display_floorconfig\">"
- "<span class=\"mainmenu\">"
- "Add, change, or delete floors"
- "</span></A><br />\n");
-
- wprintf("<A HREF=\"/display_netconf\">"
- "<span class=\"mainmenu\">"
- "Configure networking with other systems"
- "</span></A><br />\n");
-
- wprintf("<A HREF=\"/display_inetconf\">"
- "<span class=\"mainmenu\">"
- "Internet and domain configuration</span></a><br />\n");
- }
- do_template("endbox");
- }
+/*
+ * System administration menu
+ */
+void display_aide_menu(void)
+{
+ output_headers(1, 1, 2, 0, 0, 0, 0);
+ wprintf("<div id=\"banner\">\n"
+ "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+ "<SPAN CLASS=\"titlebar\">System Administration Menu</SPAN>"
+ "</TD></TR></TABLE>\n"
+ "</div>\n<div id=\"content\">\n"
+ );
+
+ wprintf("<center><table border=0 width=99%% bgcolor=\"#ffffff\"><tr><td>\n");
+
+ wprintf("<A HREF=\"/display_siteconfig\">"
+ "<span class=\"mainmenu\">"
+ "Edit site-wide configuration</span></A>\n");
+
+ wprintf("<br />"
+ "<A HREF=\"/select_user_to_edit\">"
+ "<span class=\"mainmenu\">"
+ "Add, change, delete user accounts"
+ "</span></A><br />\n");
+
+ wprintf("<A HREF=\"/validate\">"
+ "<span class=\"mainmenu\">"
+ "Validate new users</span></A><br />\n");
+
+ wprintf("<A HREF=\"/display_floorconfig\">"
+ "<span class=\"mainmenu\">"
+ "Add, change, or delete floors"
+ "</span></A><br />\n");
+
+ wprintf("<A HREF=\"/display_netconf\">"
+ "<span class=\"mainmenu\">"
+ "Configure networking with other systems"
+ "</span></A><br />\n");
+
+ wprintf("<A HREF=\"/display_inetconf\">"
+ "<span class=\"mainmenu\">"
+ "Internet and domain configuration</span></a><br />\n");
+
wprintf("</td></tr></table></center>");
wDumpContent(2);
}
*/
void display_generic(void)
{
- output_headers(1, 1, 0, 0, 0, 0, 0);
+ output_headers(1, 1, 2, 0, 0, 0, 0);
+ wprintf("<div id=\"banner\">\n"
+ "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+ "<SPAN CLASS=\"titlebar\">Enter a server command</SPAN>"
+ "</TD></TR></TABLE>\n"
+ "</div>\n<div id=\"content\">\n"
+ );
- svprintf("BOXTITLE", WCS_STRING, "Enter a server command");
- do_template("beginbox");
+ wprintf("<center><table border=0 width=99%% bgcolor=\"#ffffff\"><tr><td>\n");
wprintf("<CENTER>");
wprintf("This screen allows you to enter Citadel server commands which are\n");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><br />\n");
wprintf("</FORM></CENTER>\n");
- do_template("endbox");
+ wprintf("</td></tr></table></center>\n");
wDumpContent(1);
}
output_headers(1, 1, 1, 0, 0, 0, 0);
/* print the tabbed dialog */
- wprintf("<br /><TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
+ wprintf("<br /><center><TABLE border=0 cellspacing=0 cellpadding=0 width=99%%>"
"<TR ALIGN=CENTER>"
"<TD> </TD>\n");
wprintf("<TD> </TD>\n");
+ if (!strcmp(tab, "access")) {
+ wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+ }
+ else {
+ wprintf("<TD BGCOLOR=\"#CCCCCC\"><A HREF=\"/display_editroom&tab=access\">");
+ }
+ wprintf("Access controls");
+ if (!strcmp(tab, "access")) {
+ wprintf("</SPAN></TD>\n");
+ }
+ else {
+ wprintf("</A></TD>\n");
+ }
+
+ wprintf("<TD> </TD>\n");
+
if (!strcmp(tab, "sharing")) {
wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
}
/* end tabbed dialog */
/* begin content of whatever tab is open now */
- wprintf("<TABLE border=0 width=100%% bgcolor=\"#FFFFFF\">\n"
+ wprintf("<TABLE border=0 width=99%% bgcolor=\"#FFFFFF\">\n"
"<TR><TD>\n");
if (!strcmp(tab, "admin")) {
}
+ /* Mailing list management */
+ if (!strcmp(tab, "access")) {
+ display_whok();
+ }
/* end content of whatever tab is open now */
wprintf("</TD></TR></TABLE>\n");
return;
}
+
/*
- * Invite, Kick, and show Who Knows a room
+ * Display form for Invite, Kick, and show Who Knows a room
*/
-void display_whok(void)
-{
+void do_invt_kick(void) {
char buf[SIZ], room[SIZ], username[SIZ];
serv_puts("GETR");
serv_gets(buf);
if (buf[0] != '2') {
- strcpy(WC->ImportantMessage, &buf[4]);
- display_main_menu();
+ escputs(&buf[4]);
return;
}
extract(room, &buf[4], 0);
strcpy(username, bstr("username"));
- if(!strcmp(bstr("sc"), "Kick")) {
+ if (!strcmp(bstr("sc"), "Kick")) {
sprintf(buf, "KICK %s", username);
serv_puts(buf);
serv_gets(buf);
"<B><I>User %s kicked out of room %s.</I></B>\n",
username, room);
}
- } else if(!strcmp(bstr("sc"), "Invite")) {
+ }
+
+ if (!strcmp(bstr("sc"), "Invite")) {
sprintf(buf, "INVT %s", username);
serv_puts(buf);
serv_gets(buf);
username, room);
}
}
-
- output_headers(1, 1, 1, 0, 0, 0, 0);
- stresc(buf, WC->wc_roomname, 1, 1);
- svprintf("BOXTITLE", WCS_STRING, "Access control list for %s", buf);
- do_template("beginbox");
+ display_editroom();
+}
+
+
+
+/*
+ * Display form for Invite, Kick, and show Who Knows a room
+ */
+void display_whok(void)
+{
+ char buf[SIZ], room[SIZ], username[SIZ];
+
+ serv_puts("GETR");
+ serv_gets(buf);
+
+ if (buf[0] != '2') {
+ escputs(&buf[4]);
+ return;
+ }
+ extract(room, &buf[4], 0);
+
+
wprintf("<TABLE border=0 CELLSPACING=10><TR VALIGN=TOP>"
"<TD>The users listed below have access to this room. "
"To remove a user from the access list, select the user "
"name from the list and click 'Kick'.<br /><br />");
- wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
- wprintf("<SELECT NAME=\"username\" SIZE=10>\n");
+ wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/do_invt_kick\">\n");
+ wprintf("<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"access\">\n");
+ wprintf("<SELECT NAME=\"username\" SIZE=\"10\" style=\"width:100%%\">\n");
serv_puts("WHOK");
serv_gets(buf);
if (buf[0] == '1') {
"To grant another user access to this room, enter the "
"user name in the box below and click 'Invite'.<br /><br />");
- wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_whok\">\n");
+ wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/do_invt_kick\">\n");
+ wprintf("<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"access\">\n");
wprintf("Invite: ");
- wprintf("<input type=text name=username><br />\n"
- "<input type=hidden name=sc value=\"Invite\">"
- "<input type=submit value=\"Invite\">"
+ wprintf("<input type=\"text\" name=\"username\" style=\"width:100%%\"><br />\n"
+ "<input type=\"hidden\" name=\"sc\" value=\"Invite\">"
+ "<input type=\"submit\" value=\"Invite\">"
"</FORM></CENTER>\n");
wprintf("</TD></TR></TABLE>\n");
- do_template("endbox");
wDumpContent(1);
}
blank_page();
} else if (!strcasecmp(action, "do_template")) {
url_do_template();
+ } else if (!strcasecmp(action, "display_aide_menu")) {
+ display_aide_menu();
} else if (!strcasecmp(action, "display_main_menu")) {
display_main_menu();
} else if (!strcasecmp(action, "whobbs")) {
display_entroom();
} else if (!strcasecmp(action, "entroom")) {
entroom();
+ } else if (!strcasecmp(action, "display_whok")) {
+ display_whok();
+ } else if (!strcasecmp(action, "do_invt_kick")) {
+ do_invt_kick();
} else if (!strcasecmp(action, "display_editroom")) {
display_editroom();
} else if (!strcasecmp(action, "netedit")) {
netedit();
} else if (!strcasecmp(action, "editroom")) {
editroom();
- } else if (!strcasecmp(action, "display_whok")) {
- display_whok();
} else if (!strcasecmp(action, "display_editinfo")) {
display_edit("Room info", "EINF 0", "RINF", "/editinfo", 1);
} else if (!strcasecmp(action, "editinfo")) {
void do_welcome(void);
void do_logout(void);
void display_main_menu(void);
+void display_aide_menu(void);
void display_advanced_menu(void);
void slrp_highest(void);
void gotonext(void);
void netedit(void);
void editroom(void);
void display_whok(void);
+void do_invt_kick(void);
void server_to_text(void);
void save_edit(char *description, char *enter_cmd, int regoto);
void display_edit(char *description, char *check_cmd,