]> code.citadel.org Git - citadel.git/blobdiff - webcit/mainmenu.c
* Moved all diagnostic output to stderr
[citadel.git] / webcit / mainmenu.c
index 70183d589f2bb35ec0a9aa77bbe8e4e53990f248..c48e60b682551a9f8b7404236b45b9c0c208e2a4 100644 (file)
@@ -1,15 +1,31 @@
 /* $Id$ */
 
+
+
+
+#include <ctype.h>
 #include <stdlib.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <stdio.h>
-#include <ctype.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/types.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"
+
+
+
 
 
 /* 
@@ -35,10 +51,10 @@ void embed_main_menu(void)
        wprintf("Skip to next room</B></A><BR>\n");
        wprintf("(come back here later)</LI>\n");
 
-       if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) {
+       if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
                wprintf("<LI><B><A HREF=\"/ungoto\">\n");
                wprintf("Ungoto</B></A><BR>\n");
-               wprintf("(oops! Back to %s)</LI>\n", ugname);
+               wprintf("(oops! Back to %s)</LI>\n", WC->ugname);
        }
        wprintf("</UL>\n");
 
@@ -140,7 +156,7 @@ void embed_advanced_menu(void)
        wprintf("Create a new room</A>\n");
 
        wprintf("<LI><A HREF=\"/display_zap\">");
-       wprintf("Zap (forget) this room (%s)</A>\n", wc_roomname);
+       wprintf("Zap (forget) this room (%s)</A>\n", WC->wc_roomname);
 
        wprintf("<LI><A HREF=\"/zapped_list\">");
        wprintf("List all forgotten rooms</A>\n");
@@ -149,7 +165,7 @@ void embed_advanced_menu(void)
 
        wprintf("</TD><TD>");
 
-       if ((axlevel >= 6) || (is_room_aide)) {
+       if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
                wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007777><TR><TD>");
                wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
                wprintf("<B>Administrative functions</B>\n");
@@ -157,21 +173,12 @@ void embed_advanced_menu(void)
 
                wprintf("<UL>");
                wprintf("<LI><A HREF=\"/display_editroom\">\n");
-               wprintf("Edit this room</A>\n");
-
-               wprintf("<LI><A HREF=\"/confirm_delete_room\">\n");
-               wprintf("Delete this room</A>\n");
-
-               wprintf("<LI><A HREF=\"/display_editroompic\">\n");
-               wprintf("Set or change the graphic for this room's banner</A>\n");
-
-               wprintf("<LI><A HREF=\"/display_editinfo\">\n");
-               wprintf("Edit this room's Info file</A>\n");
+               wprintf("Edit or delete this room</A>\n");
 
                wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
                wprintf("Edit site-wide configuration</A>\n");
 
-               if (axlevel >= 6) {
+               if (WC->axlevel >= 6) {
                        wprintf("<LI><A HREF=\"/validate\">\n");
                        wprintf("Validate new users</A>\n");
 
@@ -200,7 +207,6 @@ void embed_advanced_menu(void)
  */
 void display_main_menu(void)
 {
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
        embed_main_menu();
        wDumpContent(2);
@@ -209,7 +215,6 @@ void display_main_menu(void)
 
 void display_advanced_menu(void)
 {
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
        embed_advanced_menu();
        embed_main_menu();
@@ -222,7 +227,6 @@ void display_advanced_menu(void)
  */
 void display_generic(void)
 {
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
 
        wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
@@ -262,7 +266,6 @@ void do_generic(void)
                return;
        }
 
-       printf("HTTP/1.0 200 OK\n");
        output_headers(1);
 
        serv_printf("%s", bstr("g_cmd"));
@@ -325,7 +328,6 @@ void display_menubar(int as_single_page) {
        char buf[256];
 
        if (as_single_page) {
-               printf("HTTP/1.0 200 OK\n");
                output_headers(0);
                wprintf("<HTML>\n"
                        "<HEAD>\n"