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></HEAD><BODY>\n");
32 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
33 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Users currently on ");
34 escputs(serv_info.serv_humannode);
35 wprintf("</B></FONT></TD></TR></TABLE>\n");
37 wprintf("<CENTER><TABLE border><TR>");
38 wprintf("<TH>Session ID</TH><TH>User Name</TH><TH>Room</TH>");
39 wprintf("<TH>From host</TH></TR>\n");
43 while(serv_gets(buf), strcmp(buf,"000")) {
44 sess = extract_int(buf, 0);
45 extract(user, buf, 1);
46 extract(room, buf, 2);
47 extract(host, buf, 3);
50 for (wptr = wlist; wptr != NULL; wptr = wptr -> next) {
51 if (wptr->sessionnum == sess) {
53 if (strcasecmp(user, &wptr->username)) {
54 sprintf(buf, "%cBR%c%s",
56 strcat(wptr->username, buf);
58 if (strcasecmp(room, &wptr->roomname)) {
59 sprintf(buf, "%cBR%c%s",
61 strcat(wptr->roomname, buf);
63 if (strcasecmp(host, &wptr->hostname)) {
64 sprintf(buf, "%cBR%c%s",
66 strcat(wptr->hostname, buf);
72 wptr = (struct whouser *)
73 malloc(sizeof(struct whouser));
76 strcpy(wlist->username, user);
77 strcpy(wlist->roomname, room);
78 strcpy(wlist->hostname, host);
79 wlist->sessionnum = sess;
83 while (wlist != NULL) {
84 wprintf("<TR><TD>%d</TD><TD>", wlist->sessionnum);
85 escputs(wlist->username);
87 escputs(wlist->roomname);
89 escputs(wlist->hostname);
90 wprintf("</TD></TR>\n");
96 wprintf("</TABLE></CENTER>\n");
97 printf("</BODY></HTML>\n");