19 char clientsoftware[256];
26 struct whouser *wlist = NULL;
27 struct whouser *wptr = NULL;
28 char buf[256],sess,user[256],room[256],host[256];
31 printf("HTTP/1.0 200 OK\n");
33 wprintf("<HTML><HEAD><TITLE>Who is online?</TITLE>\n");
35 /* Uncomment this line to cause the wholist to auto-refresh */
36 /* wprintf("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"60\">\n"); */
38 wprintf("</HEAD><BODY>\n");
40 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
41 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Users currently on ");
42 escputs(serv_info.serv_humannode);
43 wprintf("</B></FONT></TD></TR></TABLE>\n");
45 wprintf("<CENTER><TABLE border><TR>");
46 wprintf("<TH>Session ID</TH><TH>User Name</TH><TH>Room</TH>");
47 wprintf("<TH>From host</TH></TR>\n");
51 while(serv_gets(buf), strcmp(buf,"000")) {
52 sess = extract_int(buf, 0);
53 extract(user, buf, 1);
54 extract(room, buf, 2);
55 extract(host, buf, 3);
58 for (wptr = wlist; wptr != NULL; wptr = wptr -> next) {
59 if (wptr->sessionnum == sess) {
61 if (strcasecmp(user, wptr->username)) {
62 sprintf(buf, "%cBR%c%s",
64 strcat(wptr->username, buf);
66 if (strcasecmp(room, wptr->roomname)) {
67 sprintf(buf, "%cBR%c%s",
69 strcat(wptr->roomname, buf);
71 if (strcasecmp(host, wptr->hostname)) {
72 sprintf(buf, "%cBR%c%s",
74 strcat(wptr->hostname, buf);
80 wptr = (struct whouser *)
81 malloc(sizeof(struct whouser));
84 strcpy(wlist->username, user);
85 strcpy(wlist->roomname, room);
86 strcpy(wlist->hostname, host);
87 wlist->sessionnum = sess;
91 while (wlist != NULL) {
92 wprintf("<TR><TD>%d</TD><TD>", wlist->sessionnum);
93 escputs(wlist->username);
95 escputs(wlist->roomname);
97 escputs(wlist->hostname);
98 wprintf("</TD></TR>\n");
104 wprintf("</TABLE></CENTER>\n");
105 wprintf("</BODY></HTML>\n");