/*
* $Id$
- *
- * Display a list of all users currently logged on to the Citadel server.
*/
-
+/**
+ * \defgroup DislpayWho Display a list of all users currently logged on to the Citadel server.
+ * \ingroup WebcitDisplayItems
+ */
+/*@{*/
#include "webcit.h"
-/*
- * Display inner div of Wholist
+/**
+ * \brief Display inner div of Wholist
*/
void who_inner_div(void) {
char buf[SIZ], user[SIZ], room[SIZ], host[SIZ],
time_t now;
int bg = 0;
- wprintf("<table border=\"0\" cellspacing=\"0\" width=\"100%%\" bgcolor=\"#FFFFFF\">"
+ wprintf("<table class=\"altern\">"
"<tr>\n");
- wprintf("<th colspan=\"3\"> </th>\n");
+ wprintf("<th class=\"edit_col\"> </th>\n");
+ wprintf("<th colspan=\"2\"> </th>\n");
wprintf("<th>%s</th>\n", _("User name"));
wprintf("<th>%s</th>", _("Room"));
- wprintf("<th>%s</th>\n</tr>\n", _("From host"));
+ wprintf("<th class=\"host_col\">%s</th>\n</tr>\n", _("From host"));
serv_puts("TIME");
serv_getln(buf, sizeof buf);
last_activity = extract_long(buf, 5);
bg = 1 - bg;
- wprintf("<tr bgcolor=\"#%s\">",
- (bg ? "DDDDDD" : "FFFFFF")
+ wprintf("<tr class=\"%s\">",
+ (bg ? "even" : "odd")
);
- wprintf("<td>");
+ wprintf("<td class=\"edit_col\">");
if ((WC->is_aide) &&
(sess != WC->ctdl_pid)) {
wprintf(" <a href=\"terminate_session?which_session=%d", sess);
}
wprintf("</td>");
- /* (link to page this user) */
- wprintf("<td><a href=\"display_page?recp=");
+ /** (link to page this user) */
+ wprintf("<td width=\"5%\"><a href=\"display_page?recp=");
urlescputs(user);
wprintf("\">"
"<img align=\"middle\" "
" border=\"0\" /></a> ");
wprintf("</td>");
- /* (idle flag) */
- wprintf("<td>");
+ /** (idle flag) */
+ wprintf("<td width=\"5%\">");
if ((now - last_activity) > 900L) {
wprintf(" "
"<img align=\"middle\" "
- /* username (link to user bio/photo page) */
- wprintf("<a href=\"/showuser?who=");
+ /** username (link to user bio/photo page) */
+ wprintf("<a href=\"showuser?who=");
urlescputs(user);
wprintf("\">");
escputs(user);
wprintf("</a>");
- /* room */
+ /** room */
wprintf("</td>\n\t<td>");
escputs(room);
- if (strlen(realroom) > 0) {
+ if (!IsEmptyStr(realroom) ) {
wprintf("<br /><i>");
escputs(realroom);
wprintf("</i>");
}
- wprintf("</td>\n\t<td>");
+ wprintf("</td>\n\t<td class=\"host_col\">");
- /* hostname */
+ /** hostname */
escputs(host);
- if (strlen(realhost) > 0) {
+ if (!IsEmptyStr(realhost)) {
wprintf("<br /><i>");
escputs(realhost);
wprintf("</i>");
}
-/*
- * who is on?
+/**
+ * \brief who is on?
*/
void who(void)
{
);
wprintf("<div id=\"banner\">\n");
- wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
- wprintf("<IMG SRC=\"static/usermanag_48x.gif\" ALT=\" \" "
- "ALIGN=MIDDLE "
+ wprintf("<table class=\"who_banner\"><tr><td>");
+ wprintf("<img src=\"static/usermanag_48x.gif\" alt=\" \" "
+ "align=middle "
">");
- wprintf("<SPAN CLASS=\"titlebar\"> ");
+ wprintf("<span class=\"titlebar\"> ");
snprintf(title, sizeof title, _("Users currently on %s"), serv_info.serv_humannode);
escputs(title);
- wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
+ wprintf("</span></td><td align=right>");
offer_start_page();
- wprintf("</TD></TR></TABLE>\n");
+ wprintf("</td></tr></table>\n");
wprintf("</div>\n");
- wprintf("<div id=\"content\">\n");
+ wprintf("<div id=\"content\" class=\"who_is_online\">\n");
wprintf("<div style=\"display:inline\" id=\"fix_scrollbar_bug\">");
who_inner_div();
);
wprintf("</div>\n");
- /* JavaScript to make the ajax refresh happen:
+ /**
+ * JavaScript to make the ajax refresh happen:
* See http://www.sergiopereira.com/articles/prototype.js.html for info on Ajax.PeriodicalUpdater
* It wants: 1. The div being updated
* 2. The URL of the update source
*/
wprintf(
"<script type=\"text/javascript\"> "
- " new Ajax.PeriodicalUpdater('fix_scrollbar_bug', '/who_inner_html', "
+ " new Ajax.PeriodicalUpdater('fix_scrollbar_bug', 'who_inner_html', "
" { method: 'get', frequency: 30 } ); "
"</script> \n"
);
wDumpContent(1);
}
-
+/**
+ * \brief end session \todo what??? does this belong here?
+ */
void terminate_session(void)
{
char buf[SIZ];
}
-/*
- * Change your session info (fake roomname and hostname)
+/**
+ * \brief Change your session info (fake roomname and hostname)
*/
void edit_me(void)
{
char buf[SIZ];
- if (strlen(bstr("change_room_name_button")) > 0) {
+ if (!IsEmptyStr(bstr("change_room_name_button"))) {
serv_printf("RCHG %s", bstr("fake_roomname"));
serv_getln(buf, sizeof buf);
- http_redirect("/who");
- } else if (strlen(bstr("change_host_name_button")) > 0) {
+ http_redirect("who");
+ } else if (!IsEmptyStr(bstr("change_host_name_button"))) {
serv_printf("HCHG %s", bstr("fake_hostname"));
serv_getln(buf, sizeof buf);
- http_redirect("/who");
- } else if (strlen(bstr("change_user_name_button")) > 0) {
+ http_redirect("who");
+ } else if (!IsEmptyStr(bstr("change_user_name_button"))) {
serv_printf("UCHG %s", bstr("fake_username"));
serv_getln(buf, sizeof buf);
- http_redirect("/who");
- } else if (strlen(bstr("cancel_button")) > 0) {
- http_redirect("/who");
+ http_redirect("who");
+ } else if (!IsEmptyStr(bstr("cancel_button"))) {
+ http_redirect("who");
} else {
output_headers(1, 1, 0, 0, 0, 0);
wprintf("<div id=\"banner\">\n");
- wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
- wprintf("<SPAN CLASS=\"titlebar\">");
+ wprintf("<table class=\"who_banner\"><tr><td>");
+ wprintf("<span class=\"titlebar\">");
wprintf(_("Edit your session display"));
- wprintf("</SPAN></TD></TR></TABLE>\n");
+ wprintf("</span></td></tr></table>\n");
wprintf("</div>\n<div id=\"content\">\n");
wprintf(_("This screen allows you to change the way your "
wprintf("<br />\n");
wprintf("<form method=\"POST\" action=\"edit_me\">\n");
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
wprintf("<table border=0 width=100%%>\n");
_("Change room name"));
wprintf("</td>\n</tr>\n");
- wprintf("<TR><TD><B>");
+ wprintf("<tr><td><b>");
wprintf(_("Host name:"));
- wprintf("</B></TD><TD>");
- wprintf("<INPUT TYPE=\"text\" NAME=\"fake_hostname\" MAXLENGTH=\"64\">\n");
- wprintf("</TD>\n<TD ALIGN=center>");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"change_host_name_button\" VALUE=\"%s\">",
+ wprintf("</b></td><td>");
+ wprintf("<input type=\"text\" name=\"fake_hostname\" maxlength=\"64\">\n");
+ wprintf("</td>\n<td align=center>");
+ wprintf("<input type=\"submit\" name=\"change_host_name_button\" value=\"%s\">",
_("Change host name"));
- wprintf("</TD>\n</TR>\n");
+ wprintf("</td>\n</tr>\n");
if (WC->is_aide) {
- wprintf("<TR><TD><B>");
+ wprintf("<tr><td><b>");
wprintf(_("User name:"));
- wprintf("</B></TD><TD>");
- wprintf("<INPUT TYPE=\"text\" NAME=\"fake_username\" MAXLENGTH=\"64\">\n");
- wprintf("</TD>\n<TD ALIGN=center>");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"change_user_name_button\" VALUE=\"%s\">",
+ wprintf("</b></td><td>");
+ wprintf("<input type=\"text\" name=\"fake_username\" maxlength=\"64\">\n");
+ wprintf("</td>\n<td align=center>");
+ wprintf("<input type=\"submit\" name \"change_user_name_button\" value=\"%s\">",
_("Change user name"));
- wprintf("</TD>\n</TR>\n");
+ wprintf("</td>\n</tr>\n");
}
- wprintf("<TR><TD> </TD><TD> </TD><TD ALIGN=center>");
- wprintf("<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">",
+ wprintf("<tr><td> </td><td> </td><td align=center>");
+ wprintf("<input type=\"submit\" name=\"cancel_button\" value=\"%s\">",
_("Cancel"));
- wprintf("</TD></TR></TABLE>\n");
- wprintf("</FORM></CENTER>\n");
+ wprintf("</td></tr></table>\n");
+ wprintf("</form></center>\n");
wDumpContent(1);
}
}
+
+
+/*@}*/