21 char clientsoftware[256];
28 struct whouser *wlist = NULL;
29 struct whouser *wptr = NULL;
30 char buf[256],sess,user[256],room[256],host[256];
33 printf("HTTP/1.0 200 OK\n");
34 output_headers(1, "bottom");
36 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
37 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Users currently on ");
38 escputs(serv_info.serv_humannode);
39 wprintf("</B></FONT></TD></TR></TABLE>\n");
41 wprintf("<CENTER><TABLE border><TR>");
42 wprintf("<TH>Session ID</TH><TH>User Name</TH><TH>Room</TH>");
43 wprintf("<TH>From host</TH></TR>\n");
47 while(serv_gets(buf), strcmp(buf,"000")) {
48 sess = extract_int(buf, 0);
49 extract(user, buf, 1);
50 extract(room, buf, 2);
51 extract(host, buf, 3);
54 for (wptr = wlist; wptr != NULL; wptr = wptr -> next) {
55 if (wptr->sessionnum == sess) {
57 if (strcasecmp(user, wptr->username)) {
58 sprintf(buf, "%cBR%c%s",
60 strcat(wptr->username, buf);
62 if (strcasecmp(room, wptr->roomname)) {
63 sprintf(buf, "%cBR%c%s",
65 strcat(wptr->roomname, buf);
67 if (strcasecmp(host, wptr->hostname)) {
68 sprintf(buf, "%cBR%c%s",
70 strcat(wptr->hostname, buf);
76 wptr = (struct whouser *)
77 malloc(sizeof(struct whouser));
80 strcpy(wlist->username, user);
81 strcpy(wlist->roomname, room);
82 strcpy(wlist->hostname, host);
83 wlist->sessionnum = sess;
87 while (wlist != NULL) {
88 wprintf("<TR><TD>%d", wlist->sessionnum);
90 (wlist->sessionnum != serv_info.serv_pid) ) {
91 wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", wlist->sessionnum);
92 urlescputs(wlist->username);
93 wprintf("\">(kill)</A>");
95 if (wlist->sessionnum == serv_info.serv_pid) {
96 wprintf(" <A HREF=\"/edit_me\">(edit)</A>");
99 escputs(wlist->username);
100 wprintf("</TD><TD>");
101 escputs(wlist->roomname);
102 wprintf("</TD><TD>");
103 escputs(wlist->hostname);
104 wprintf("</TD></TR>\n");
110 wprintf("</TABLE>\n");
111 wprintf("<A HREF=\"/whobbs\">Refresh</A>\n");
112 wprintf("</CENTER></BODY></HTML>\n");
117 void terminate_session(void) {
120 if (!strcasecmp(bstr("confirm"), "Yes")) {
121 serv_printf("TERM %s", bstr("which_session"));
127 display_error(&buf[4]);
132 printf("HTTP/1.0 200 OK\n");
133 output_headers(1, "bottom");
134 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
135 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Confirm session termination");
136 wprintf("</B></FONT></TD></TR></TABLE>\n");
138 wprintf("Are you sure you want to terminate session %s",
139 bstr("which_session"));
140 if (strlen(bstr("session_owner"))>0) {
142 escputs(bstr("session_owner"));
145 wprintf("?<BR><BR>\n");
147 wprintf("<A HREF=\"/terminate_session&which_session=%s&confirm=yes\">",
148 bstr("which_session"));
149 wprintf("Yes</A> ");
150 wprintf("<A HREF=\"/whobbs\">No</A>");
151 wprintf("</BODY></HTML>\n");
160 * Change your session info (fake roomname and hostname)
165 printf("HTTP/1.0 200 OK\n");
166 output_headers(1, "bottom");
168 if (!strcasecmp(bstr("sc"), "Change room name")) {
169 serv_printf("RCHG %s", bstr("fake_roomname"));
173 else if (!strcasecmp(bstr("sc"), "Change host name")) {
174 serv_printf("HCHG %s", bstr("fake_hostname"));
178 else if (!strcasecmp(bstr("sc"), "Change user name")) {
179 serv_printf("UCHG %s", bstr("fake_username"));
183 else if (!strcasecmp(bstr("sc"), "Cancel")) {
188 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
189 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>");
190 wprintf("Edit your session display");
191 wprintf("</B></FONT></TD></TR></TABLE>\n");
193 wprintf("This screen allows you to change the way your\n");
194 wprintf("session appears in the 'Who is online' listing.\n");
195 wprintf("To turn off any 'fake' name you've previously\n");
196 wprintf("set, simply click the appropriate 'change' button\n");
197 wprintf("without typing anything in the corresponding box.\n");
200 wprintf("<FORM METHOD=\"POST\" ACTION=\"/edit_me\">\n");
202 wprintf("<TABLE border=0 width=100%>\n");
204 wprintf("<TR><TD>Room name:</TD><TD>");
205 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_roomname\" MAXLENGTH=\"64\">\n");
206 wprintf("</TD><TD>");
207 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change room name\">");
208 wprintf("</TD></TR>\n");
210 wprintf("<TR><TD>Host name:</TD><TD>");
211 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_hostname\" MAXLENGTH=\"64\">\n");
212 wprintf("</TD><TD>");
213 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change host name\">");
214 wprintf("</TD></TR>\n");
217 wprintf("<TR><TD>User name:</TD><TD>");
218 wprintf("<INPUT TYPE=\"text\" NAME=\"fake_username\" MAXLENGTH=\"64\">\n");
219 wprintf("</TD><TD>");
220 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change user name\">");
221 wprintf("</TD></TR>\n");
224 wprintf("<TR><TD></TD><TD></TD><TD>");
225 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
226 wprintf("</TD></TR></TABLE>\n");
228 wprintf("</FORM></CENTER></BODY></HTML>\n");