* converted to autoconf and began port to Digital UNIX
[citadel.git] / webcit / who.c
index d4bb93e6c1ce04efd594f3a6e25293d9c013f0ed..5f8937b7a1284ecad8deb30aa328bdd840108ab9 100644 (file)
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -6,6 +8,7 @@
 #include <ctype.h>
 #include <string.h>
 #include "webcit.h"
+#include "child.h"
 
 struct whouser {
        struct whouser *next;
@@ -19,7 +22,7 @@ struct whouser {
 /*
  * who is on?
  */
-void whobbs() {
+void whobbs(void) {
        struct whouser *wlist = NULL;
        struct whouser *wptr = NULL;
        char buf[256],sess,user[256],room[256],host[256];
@@ -27,7 +30,12 @@ void whobbs() {
 
         printf("HTTP/1.0 200 OK\n");
         output_headers();
-        wprintf("<HTML><HEAD><TITLE>Who is online?</TITLE></HEAD><BODY>\n");
+        wprintf("<HTML><HEAD><TITLE>Who is online?</TITLE>\n");
+
+       /* Uncomment this line to cause the wholist to auto-refresh */
+       /* wprintf("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"60\">\n"); */
+
+       wprintf("</HEAD><BODY>\n");
 
         wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
         wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Users currently on ");
@@ -50,17 +58,17 @@ void whobbs() {
                        for (wptr = wlist; wptr != NULL; wptr = wptr -> next) {
                                if (wptr->sessionnum == sess) {
                                        foundit = 1;
-                                       if (strcasecmp(user, &wptr->username)) {
+                                       if (strcasecmp(user, wptr->username)) {
                                                sprintf(buf, "%cBR%c%s", 
                                                        LB, RB, user);
                                                strcat(wptr->username, buf);
                                                }
-                                       if (strcasecmp(room, &wptr->roomname)) {
+                                       if (strcasecmp(room, wptr->roomname)) {
                                                sprintf(buf, "%cBR%c%s", 
                                                        LB, RB, room);
                                                strcat(wptr->roomname, buf);
                                                }
-                                       if (strcasecmp(host, &wptr->hostname)) {
+                                       if (strcasecmp(host, wptr->hostname)) {
                                                sprintf(buf, "%cBR%c%s", 
                                                        LB, RB, host);
                                                strcat(wptr->hostname, buf);
@@ -94,7 +102,7 @@ void whobbs() {
                        }
                }
        wprintf("</TABLE></CENTER>\n");
-        printf("</BODY></HTML>\n");
+        wprintf("</BODY></HTML>\n");
         wDumpContent();
        }