-/*
- * Display inner div of Wholist
- * /
-void who_inner_div(void) {
- UserStateStruct *User;
- void *VUser;
- char buf[SIZ];
- struct wcsession *WCC = WC;
- HashList *List;
- HashPos *it;
- const char *UserName;
- long len;
- time_t now;
- int bg = 0;
- wprintf("<table class=\"altern\">"
- "<tr>\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 class=\"host_col\">%s</th>\n</tr>\n", _("From host"));
-
- serv_puts("TIME");
- serv_getln(buf, sizeof buf);
-
- if (buf[0] == '2') {
- now = extract_long(&buf[4], 0);
- }
- else {
- now = time(NULL);
- }
-
- List = NewHash(1, NULL);
-
- if (GetWholistSection(List, now)) {
- it = GetNewHashPos();
- while (GetNextHashPos(List, it, &len, &UserName, &VUser)) {
- User = VUser;
- bg = 1 - bg;
- wprintf("<tr class=\"%s\">",
- (bg ? "even" : "odd")
- );
-
-
- wprintf("<td class=\"edit_col\">");
- if ((WCC->is_aide) &&
- (User->Session != WCC->ctdl_pid)) {
- wprintf(" <a href=\"terminate_session?which_session=%d", User->Session);
- wprintf("\" onClick=\"return ConfirmKill();\">%s</a>", _("(kill)"));
- }
- if (User->Session == WCC->ctdl_pid) {
- wprintf(" <a href=\"edit_me\">%s</a>", _("(edit)"));
- }
- wprintf("</td>");
-
- / * (link to page this user) * /
- wprintf("<td width=\"5%%\"><a href=\"display_page?recp=");
- UrlescPutStrBuf(User->UserName);
- wprintf("\">"
- "<img align=\"middle\" "
- "src=\"static/citadelchat_24x.gif\" "
- "alt=\"(p)\""
- " border=\"0\" /></a> ");
- wprintf("</td>");
-
- / * (idle flag) * /
- wprintf("<td width=\"5%%\">");
- if (User->Idle) {
- wprintf(" "
- "<img align=\"middle\" "
- "src=\"static/inactiveuser_24x.gif\" "
- "alt=\"(%s %ld %s)\" border=\"0\" />",
- _("idle since"),
- (now - User->LastActive) / 60,
- _("Minutes")
- );
-
- }
- else {
- wprintf(" "
- "<img align=\"middle\" "
- "src=\"static/activeuser_24x.gif\" "
- "alt=\"(active)\" border=\"0\" />");
- }
- wprintf("</td>\n<td>");
-
- / * username (link to user bio/photo page) * /
- wprintf("<a href=\"showuser?who=");
- UrlescPutStrBuf(User->UserName);
- wprintf("\">");
- StrEscPuts(User->UserName);
- if (User->SessionCount > 1)
- wprintf(" [%d] ", User->SessionCount);
- wprintf("</a>");
-
- / * room * /
- wprintf("</td>\n\t<td>");
- StrEscPuts(User->Room);
- if (StrLength(User->RealRoom) > 0) {
- wprintf("<br /><i>");
- StrEscPuts(User->RealRoom);
- wprintf("</i>");
- }
- wprintf("</td>\n\t<td class=\"host_col\">");
-
- / * hostname * /
- StrEscPuts(User->Host);
- if (StrLength(User->RealHost) > 0) {
- wprintf("<br /><i>");
- StrEscPuts(User->RealHost);
- wprintf("</i>");
- }
- wprintf("</td>\n</tr>");
- }
- DeleteHashPos(&it);
- }
- wprintf("</table>");
- DeleteHash(&List);
-}
-*/
-
-
-#if 0
-/*
- * Display a list of users currently logged in to the system
- * /
-void who(void)
-{
- char title[256];
-
- output_headers(1, 1, 2, 0, 0, 0);
-
- wprintf("<script type=\"text/javascript\">\n"
- "function ConfirmKill() { \n"
- "return confirm('%s');\n"
- "}\n"
- "</script>\n", _("Do you really want to kill this session?")
- );
-#endif
-
- wprintf("<div id=\"banner\">\n");
- wprintf("<div class=\"room_banner\">");
- wprintf("<img src=\"static/usermanag_48x.gif\">");
- wprintf("<h1>");
- snprintf(title, sizeof title, _("Users currently on %s"), serv_info.serv_humannode);
- escputs(title);
- wprintf("</h1></div>");
- wprintf("<ul class=\"room_actions\">\n");
- wprintf("<li class=\"start_page\">");
- offer_start_page();
- wprintf("</li></ul>");
- wprintf("</div>");
-
- wprintf("<div id=\"content\" class=\"fix_scrollbar_bug who_is_online\">\n");
- wprintf("<div class=\"box\">");
- wprintf("<div class=\"boxlabel\">");
- snprintf(title, sizeof title, _("Users currently on %s"), serv_info.serv_humannode);
- escputs(title);
- wprintf("</div>");
- wprintf("<div class=\"boxcontent\">");
- wprintf("<div id=\"who_inner\" >");
- who_inner_div();
- wprintf("</div>");
-
- wprintf("<div class=\"instructions\">");
- wprintf(_("Click on a name to read user info. Click on %s "
- "to send an instant message to that user."),
- "<img align=\"middle\" src=\"static/citadelchat_16x.gif\" alt=\"(p)\" border=\"0\">"
- );
- wprintf("</div></div>\n");
-
- / *
- * 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
- * 3. Other flags (such as the HTTP method and the refresh frequency)
- * /
- wprintf(
- "<script type=\"text/javascript\"> "
- " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
- " { method: 'get', frequency: 30 } ); "
- "</script> \n"
- );
- wDumpContent(1);
-}
-*/
-#endif
-