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");
35 wprintf("<HTML><HEAD><TITLE>Who is online?</TITLE>\n");
37 /* Uncomment this line to cause the wholist to auto-refresh */
38 /* wprintf("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"60\">\n"); */
40 wprintf("</HEAD><BODY BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
42 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
43 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Users currently on ");
44 escputs(serv_info.serv_humannode);
45 wprintf("</B></FONT></TD></TR></TABLE>\n");
47 wprintf("<CENTER><TABLE border><TR>");
48 wprintf("<TH>Session ID</TH><TH>User Name</TH><TH>Room</TH>");
49 wprintf("<TH>From host</TH></TR>\n");
53 while(serv_gets(buf), strcmp(buf,"000")) {
54 sess = extract_int(buf, 0);
55 extract(user, buf, 1);
56 extract(room, buf, 2);
57 extract(host, buf, 3);
60 for (wptr = wlist; wptr != NULL; wptr = wptr -> next) {
61 if (wptr->sessionnum == sess) {
63 if (strcasecmp(user, wptr->username)) {
64 sprintf(buf, "%cBR%c%s",
66 strcat(wptr->username, buf);
68 if (strcasecmp(room, wptr->roomname)) {
69 sprintf(buf, "%cBR%c%s",
71 strcat(wptr->roomname, buf);
73 if (strcasecmp(host, wptr->hostname)) {
74 sprintf(buf, "%cBR%c%s",
76 strcat(wptr->hostname, buf);
82 wptr = (struct whouser *)
83 malloc(sizeof(struct whouser));
86 strcpy(wlist->username, user);
87 strcpy(wlist->roomname, room);
88 strcpy(wlist->hostname, host);
89 wlist->sessionnum = sess;
93 while (wlist != NULL) {
94 wprintf("<TR><TD>%d</TD><TD>", wlist->sessionnum);
95 escputs(wlist->username);
97 escputs(wlist->roomname);
99 escputs(wlist->hostname);
100 wprintf("</TD></TR>\n");
106 wprintf("</TABLE></CENTER>\n");
107 wprintf("</BODY></HTML>\n");