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");
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 wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", wlist->sessionnum);
91 urlescputs(wlist->username);
92 wprintf("\">(kill)</A>");
95 escputs(wlist->username);
97 escputs(wlist->roomname);
99 escputs(wlist->hostname);
100 wprintf("</TD></TR>\n");
106 wprintf("</TABLE>\n");
107 wprintf("<A HREF=\"/whobbs\">Refresh</A>\n");
108 wprintf("</CENTER></BODY></HTML>\n");
113 void terminate_session(void) {
116 if (!strcasecmp(bstr("confirm"), "Yes")) {
117 serv_printf("TERM %s", bstr("which_session"));
123 display_error(&buf[4]);
128 printf("HTTP/1.0 200 OK\n");
130 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
131 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Confirm session termination");
132 wprintf("</B></FONT></TD></TR></TABLE>\n");
134 wprintf("Are you sure you want to terminate session %s",
135 bstr("which_session"));
136 if (strlen(bstr("session_owner"))>0) {
138 escputs(bstr("session_owner"));
141 wprintf("?<BR><BR>\n");
143 wprintf("<A HREF=\"/terminate_session&which_session=%s&confirm=yes\">",
144 bstr("which_session"));
145 wprintf("Yes</A> ");
146 wprintf("<A HREF=\"/whobbs\">No</A>");
147 wprintf("</BODY></HTML>\n");