11 #include <sys/socket.h>
14 #include <netinet/in.h>
34 char buf[SIZ], sess, user[SIZ], room[SIZ], host[SIZ],
35 realroom[SIZ], realhost[SIZ];
40 output_headers(1, 1, 2, 0, 1, 0, 0);
42 wprintf("<script type=\"text/javascript\">\n"
43 "function ConfirmKill() { \n"
44 "return confirm('Do you really want to kill this session?');\n"
49 wprintf("<div id=\"banner\">\n");
50 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
51 wprintf("<IMG SRC=\"/static/users-icon.gif\" ALT=\" \" ALIGN=MIDDLE>");
52 wprintf("<SPAN CLASS=\"titlebar\"> Users currently on ");
53 escputs(serv_info.serv_humannode);
54 wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
56 wprintf("</TD></TR></TABLE>\n");
58 "<div id=\"content\">\n");
60 do_template("beginbox_nt");
62 "<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%%>\n<TR>\n");
63 wprintf("<TH COLSPAN=4>Session ID</TH>\n");
64 wprintf("<TH>User Name</TH>\n");
65 wprintf("<TH>Room</TH>");
66 wprintf("<TH>From host</TH>\n</TR>\n");
71 now = extract_long(&buf[4], 0);
80 while (serv_gets(buf), strcmp(buf, "000")) {
81 sess = extract_int(buf, 0);
82 extract(user, buf, 1);
83 extract(room, buf, 2);
84 extract(host, buf, 3);
85 extract(realroom, buf, 9);
86 extract(realhost, buf, 10);
87 last_activity = extract_long(buf, 5);
90 wprintf("<TR BGCOLOR=\"#%s\">",
91 (bg ? "DDDDDD" : "FFFFFF")
95 wprintf("<TD>%d</TD><TD>", sess);
97 (sess != WC->ctdl_pid)) {
98 wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", sess);
100 wprintf("\" onClick=\"return ConfirmKill();\" "
103 if (sess == WC->ctdl_pid) {
104 wprintf(" <A HREF=\"/edit_me\" "
109 /* (link to page this user) */
110 wprintf("<TD><A HREF=\"/display_page&recp=");
113 "<IMG ALIGN=MIDDLE WIDTH=20 HEIGHT=15 "
114 "SRC=\"/static/page.gif\" "
116 " BORDER=0></A> ");
121 if ((now - last_activity) > 900L) {
124 "SRC=\"/static/idle.gif\" "
125 "ALT=\"[idle]\" BORDER=0>");
127 wprintf("</TD>\n\t<TD>");
131 /* username (link to user bio/photo page) */
132 wprintf("<A HREF=\"/showuser&who=");
139 wprintf("</TD>\n\t<TD>");
141 if (strlen(realroom) > 0) {
142 wprintf("<br /><I>");
146 wprintf("</TD>\n\t<TD>");
150 if (strlen(realhost) > 0) {
151 wprintf("<br /><I>");
155 wprintf("</TD>\n</TR>");
159 "Click on a name to read user info. Click on "
160 "<IMG ALIGN=MIDDLE SRC=\"/static/page.gif\" ALT=\"(p)\" "
162 "a page (instant message) to that user.<br /></CENTER>\n");
163 do_template("endbox");
168 void terminate_session(void)
172 serv_printf("TERM %s", bstr("which_session"));
179 * Change your session info (fake roomname and hostname)
185 if (!strcasecmp(bstr("sc"), "Change room name")) {
186 serv_printf("RCHG %s", bstr("fake_roomname"));
188 http_redirect("/whobbs");
189 } else if (!strcasecmp(bstr("sc"), "Change host name")) {
190 serv_printf("HCHG %s", bstr("fake_hostname"));
192 http_redirect("/whobbs");
193 } else if (!strcasecmp(bstr("sc"), "Change user name")) {
194 serv_printf("UCHG %s", bstr("fake_username"));
196 http_redirect("/whobbs");
197 } else if (!strcasecmp(bstr("sc"), "Cancel")) {
198 http_redirect("/whobbs");
201 output_headers(1, 1, 0, 0, 0, 0, 0);
203 wprintf("<div id=\"banner\">\n");
204 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
205 wprintf("<SPAN CLASS=\"titlebar\">");
206 wprintf("Edit your session display");
207 wprintf("</SPAN></TD></TR></TABLE>\n");
208 wprintf("</div>\n<div id=\"content\">\n");
210 wprintf("This screen allows you to change the way your\n");
211 wprintf("session appears in the 'Who is online' listing.\n");
212 wprintf("To turn off any 'fake' name you've previously\n");
213 wprintf("set, simply click the appropriate 'change' button\n");
214 wprintf("without typing anything in the corresponding box.\n");
217 wprintf("<FORM METHOD=\"POST\" ACTION=\"/edit_me\">\n");
219 wprintf("<TABLE border=0 width=100%%>\n");
221 wprintf("<TR><TD><B>Room name:</B></TD>\n<TD>");
222 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_roomname\" MAXLENGTH=\"64\">\n");
223 wprintf("</TD>\n<TD ALIGN=center>");
224 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change room name\">");
225 wprintf("</TD>\n</TR>\n");
227 wprintf("<TR><TD><B>Host name:</B></TD><TD>");
228 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_hostname\" MAXLENGTH=\"64\">\n");
229 wprintf("</TD>\n<TD ALIGN=center>");
230 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change host name\">");
231 wprintf("</TD>\n</TR>\n");
234 wprintf("<TR><TD><B>User name:</B></TD><TD>");
235 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_username\" MAXLENGTH=\"64\">\n");
236 wprintf("</TD>\n<TD ALIGN=center>");
237 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change user name\">");
238 wprintf("</TD>\n</TR>\n");
240 wprintf("<TR><TD> </TD><TD> </TD><TD ALIGN=center>");
241 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
242 wprintf("</TD></TR></TABLE>\n");
244 wprintf("</FORM></CENTER>\n");