]> code.citadel.org Git - citadel.git/blobdiff - webcit/who.c
* Moved all diagnostic output to stderr
[citadel.git] / webcit / who.c
index 3714318699f9bcb4061fd71f396092952ee2f7ca..67fe43c64c0d05cd9ba94cd6e5fa63d19dd699cb 100644 (file)
@@ -1,16 +1,34 @@
 /* $Id$ */
 
+
+
+
+#include <ctype.h>
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <stdio.h>
+#include <fcntl.h>
 #include <signal.h>
 #include <sys/types.h>
-#include <ctype.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <limits.h>
+#include <netinet/in.h>
+#include <netdb.h>
 #include <string.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <signal.h>
 #include "webcit.h"
-#include "child.h"
+
+
+
+
+
+
 
 struct whouser {
        struct whouser *next;
@@ -31,7 +49,6 @@ void whobbs(void)
        char buf[256], sess, user[256], room[256], host[256];
        int foundit;
 
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
 
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
@@ -89,7 +106,7 @@ void whobbs(void)
 
                while (wlist != NULL) {
                        wprintf("<TR>\n\t<TD ALIGN=center><FONT FACE=\"Arial,Helvetica,sans-serif\">%d", wlist->sessionnum);
-                       if ((is_aide) &&
+                       if ((WC->is_aide) &&
                            (wlist->sessionnum != serv_info.serv_pid)) {
                                wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", wlist->sessionnum);
                                urlescputs(wlist->username);
@@ -150,7 +167,6 @@ void terminate_session(void)
                        display_error(&buf[4]);
                }
        } else {
-               printf("HTTP/1.0 200 OK\n");
                output_headers(1);
                wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
                wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\" SIZE=+1 COLOR=\"FFFFFF\"<B>Confirm session termination");
@@ -183,9 +199,6 @@ void edit_me(void)
 {
        char buf[256];
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1);
-
        if (!strcasecmp(bstr("sc"), "Change room name")) {
                serv_printf("RCHG %s", bstr("fake_roomname"));
                serv_gets(buf);
@@ -202,6 +215,8 @@ void edit_me(void)
                whobbs();
        } else {
 
+               output_headers(1);
+
                wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
                wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\" SIZE=+1 COLOR=\"FFFFFF\"><B>");
                wprintf("Edit your session display");
@@ -230,7 +245,7 @@ void edit_me(void)
                wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\"><INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Change host name\">");
                wprintf("</FONT></TD>\n</TR>\n");
 
-               if (is_aide) {
+               if (WC->is_aide) {
                        wprintf("<TR><TD><FONT FACE=\"Arial,Helvetica,sans-serif\"><B>User name:</B></FONT></TD><TD>");
                        wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\"><INPUT TYPE=\"text\" NAME=\"fake_username\" MAXLENGTH=\"64\">\n");
                        wprintf("</FONT></TD>\n<TD ALIGN=center>");