16 char clientsoftware[256];
23 struct whouser *wlist = NULL;
24 struct whouser *wptr = NULL;
25 char buf[256],sess,user[256],room[256],host[256];
28 printf("HTTP/1.0 200 OK\n");
30 wprintf("<HTML><HEAD><TITLE>Who is online?</TITLE>\n");
32 /* Uncomment this line to cause the wholist to auto-refresh */
33 /* wprintf("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"60\">\n"); */
35 wprintf("</HEAD><BODY>\n");
37 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
38 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Users currently on ");
39 escputs(serv_info.serv_humannode);
40 wprintf("</B></FONT></TD></TR></TABLE>\n");
42 wprintf("<CENTER><TABLE border><TR>");
43 wprintf("<TH>Session ID</TH><TH>User Name</TH><TH>Room</TH>");
44 wprintf("<TH>From host</TH></TR>\n");
48 while(serv_gets(buf), strcmp(buf,"000")) {
49 sess = extract_int(buf, 0);
50 extract(user, buf, 1);
51 extract(room, buf, 2);
52 extract(host, buf, 3);
55 for (wptr = wlist; wptr != NULL; wptr = wptr -> next) {
56 if (wptr->sessionnum == sess) {
58 if (strcasecmp(user, wptr->username)) {
59 sprintf(buf, "%cBR%c%s",
61 strcat(wptr->username, buf);
63 if (strcasecmp(room, wptr->roomname)) {
64 sprintf(buf, "%cBR%c%s",
66 strcat(wptr->roomname, buf);
68 if (strcasecmp(host, wptr->hostname)) {
69 sprintf(buf, "%cBR%c%s",
71 strcat(wptr->hostname, buf);
77 wptr = (struct whouser *)
78 malloc(sizeof(struct whouser));
81 strcpy(wlist->username, user);
82 strcpy(wlist->roomname, room);
83 strcpy(wlist->hostname, host);
84 wlist->sessionnum = sess;
88 while (wlist != NULL) {
89 wprintf("<TR><TD>%d</TD><TD>", wlist->sessionnum);
90 escputs(wlist->username);
92 escputs(wlist->roomname);
94 escputs(wlist->hostname);
95 wprintf("</TD></TR>\n");
101 wprintf("</TABLE></CENTER>\n");
102 wprintf("</BODY></HTML>\n");