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];
42 wprintf("<SCRIPT LANGUAGE=\"JavaScript\">\n"
43 "function ConfirmKill() { \n"
44 "return confirm('Do you really want to kill this session?');\n"
49 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>");
50 wprintf("<IMG SRC=\"/static/users-icon.gif\" ALT=\" \" ALIGN=MIDDLE>");
51 wprintf("<SPAN CLASS=\"titlebar\"> Users currently on ");
52 escputs(serv_info.serv_humannode);
53 wprintf("</SPAN></TD><TD>");
55 wprintf("</TD></TR></TABLE><BR>\n");
57 do_template("beginbox_nt");
59 "<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%%>\n<TR>\n");
60 wprintf("<TH COLSPAN=4>Session ID</TH>\n");
61 wprintf("<TH>User Name</TH>\n");
62 wprintf("<TH>Room</TH>");
63 wprintf("<TH>From host</TH>\n</TR>\n");
68 now = extract_long(&buf[4], 0);
77 while (serv_gets(buf), strcmp(buf, "000")) {
78 sess = extract_int(buf, 0);
79 extract(user, buf, 1);
80 extract(room, buf, 2);
81 extract(host, buf, 3);
82 extract(realroom, buf, 9);
83 extract(realhost, buf, 10);
84 last_activity = extract_long(buf, 5);
87 wprintf("<TR BGCOLOR=\"#%s\">",
88 (bg ? "DDDDDD" : "FFFFFF")
92 wprintf("<TD>%d</TD><TD>", sess);
94 (sess != serv_info.serv_pid)) {
95 wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", sess);
97 wprintf("\" onClick=\"return ConfirmKill();\" "
100 if (sess == serv_info.serv_pid) {
101 wprintf(" <A HREF=\"/edit_me\" "
106 /* (link to page this user) */
107 wprintf("<TD><A HREF=\"/display_page&recp=");
110 "<IMG ALIGN=MIDDLE WIDTH=20 HEIGHT=15 "
111 "SRC=\"/static/page.gif\" "
113 " BORDER=0></A> ");
118 if ((now - last_activity) > 900L) {
121 "SRC=\"/static/idle.gif\" "
122 "ALT=\"[idle]\" BORDER=0>");
124 wprintf("</TD>\n\t<TD>");
128 /* username (link to user bio/photo page) */
129 wprintf("<A HREF=\"/showuser&who=");
136 wprintf("</TD>\n\t<TD>");
138 if (strlen(realroom) > 0) {
143 wprintf("</TD>\n\t<TD>");
147 if (strlen(realhost) > 0) {
152 wprintf("</TD>\n</TR>");
156 "Click on a name to read user info. Click on "
157 "<IMG ALIGN=MIDDLE SRC=\"/static/page.gif\" ALT=\"(p)\" "
159 "a page (instant message) to that user.<BR></CENTER>\n");
160 do_template("endbox");
165 void terminate_session(void)
169 serv_printf("TERM %s", bstr("which_session"));
176 * Change your session info (fake roomname and hostname)
182 if (!strcasecmp(bstr("sc"), "Change room name")) {
183 serv_printf("RCHG %s", bstr("fake_roomname"));
185 http_redirect("/whobbs");
186 } else if (!strcasecmp(bstr("sc"), "Change host name")) {
187 serv_printf("HCHG %s", bstr("fake_hostname"));
189 http_redirect("/whobbs");
190 } else if (!strcasecmp(bstr("sc"), "Change user name")) {
191 serv_printf("UCHG %s", bstr("fake_username"));
193 http_redirect("/whobbs");
194 } else if (!strcasecmp(bstr("sc"), "Cancel")) {
195 http_redirect("/whobbs");
200 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>");
201 wprintf("<SPAN CLASS=\"titlebar\">");
202 wprintf("Edit your session display");
203 wprintf("</SPAN></TD></TR></TABLE>\n");
204 wprintf("This screen allows you to change the way your\n");
205 wprintf("session appears in the 'Who is online' listing.\n");
206 wprintf("To turn off any 'fake' name you've previously\n");
207 wprintf("set, simply click the appropriate 'change' button\n");
208 wprintf("without typing anything in the corresponding box.\n");
211 wprintf("<FORM METHOD=\"POST\" ACTION=\"/edit_me\">\n");
213 wprintf("<TABLE border=0 width=100%%>\n");
215 wprintf("<TR><TD><B>Room name:</B></TD>\n<TD>");
216 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_roomname\" MAXLENGTH=\"64\">\n");
217 wprintf("</TD>\n<TD ALIGN=center>");
218 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change room name\">");
219 wprintf("</TD>\n</TR>\n");
221 wprintf("<TR><TD><B>Host name:</B></TD><TD>");
222 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_hostname\" MAXLENGTH=\"64\">\n");
223 wprintf("</TD>\n<TD ALIGN=center>");
224 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change host name\">");
225 wprintf("</TD>\n</TR>\n");
228 wprintf("<TR><TD><B>User name:</B></TD><TD>");
229 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_username\" MAXLENGTH=\"64\">\n");
230 wprintf("</TD>\n<TD ALIGN=center>");
231 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change user name\">");
232 wprintf("</TD>\n</TR>\n");
234 wprintf("<TR><TD> </TD><TD> </TD><TD ALIGN=center>");
235 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
236 wprintf("</TD></TR></TABLE>\n");
238 wprintf("</FORM></CENTER>\n");