* All OS-level includes are now included from webcit.h instead of from
[citadel.git] / webcit / mainmenu.c
index 5a0af2f7d9d272fea88567c874c3658853f4f681..c7e15823fa14d8967247a6bfe268d0684f1707be 100644 (file)
@@ -5,29 +5,8 @@
  *
  */
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.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"
 
-
-
 /*
  * The Main Menu
  */
@@ -35,7 +14,8 @@ void display_main_menu(void)
 {
        output_headers(1, 1, 1, 0, 0, 0, 0);
 
-       wprintf("<center><TABLE WIDTH=99%%>"
+       wprintf("<div id=\"fix_scrollbar_bug\">"
+               "<TABLE WIDTH=100%%>"
                "<TR><TD COLSPAN=2>\n");
 
        svprintf("BOXTITLE", WCS_STRING, "Basic commands");
@@ -135,9 +115,14 @@ void display_main_menu(void)
        svprintf("BOXTITLE", WCS_STRING, "Your info");
        do_template("beginbox");
 
+       wprintf("<A HREF=\"/display_preferences\">"
+               "<span class=\"mainmenu\">"
+               "Change your preferences and settings"
+               "</span><br />\n");
+
        wprintf("<A HREF=\"/display_reg\">"
                "<span class=\"mainmenu\">"
-               "Update your contact information "
+               "Update your contact information"
                "</span><br />\n");
 
        wprintf("<A HREF=\"/display_changepw\">"
@@ -184,7 +169,7 @@ void display_main_menu(void)
 
        do_template("endbox");
 
-       wprintf("</td></tr></table></center>");
+       wprintf("</td></tr></table></div>");
        wDumpContent(2);
 }
 
@@ -202,14 +187,33 @@ void display_aide_menu(void)
                "</div>\n<div id=\"content\">\n"
        );
 
-       wprintf("<center><table border=0 width=99%% bgcolor=\"#ffffff\"><tr><td>\n");
+       wprintf("<div id=\"fix_scrollbar_bug\">"
+               "<table border=0 width=100%%><tr valign=top><td>");
+
+       svprintf("BOXTITLE", WCS_STRING, "Global Configuration");
+       do_template("beginbox");
 
        wprintf("<A HREF=\"/display_siteconfig\">"
                "<span class=\"mainmenu\">"
-               "Edit site-wide configuration</span></A>\n");
+               "Edit site-wide configuration</span></A><br />\n");
+
+       wprintf("<A HREF=\"/display_inetconf\">"
+               "<span class=\"mainmenu\">"
+               "Domain names and Internet mail configuration</span></a><br />\n");
+
+       wprintf("<A HREF=\"/display_netconf\">"
+               "<span class=\"mainmenu\">"
+               "Configure replication with other Citadel servers"
+               "</span></A>\n");
+
+       do_template("endbox");
 
-       wprintf("<br />"
-               "<A HREF=\"/select_user_to_edit\">"
+       wprintf("</td><td>");
+
+       svprintf("BOXTITLE", WCS_STRING, "User account management");
+       do_template("beginbox");
+
+       wprintf("<A HREF=\"/select_user_to_edit\">"
                "<span class=\"mainmenu\">"
                "Add, change, delete user accounts"
                "</span></A><br />\n");
@@ -218,21 +222,19 @@ void display_aide_menu(void)
                "<span class=\"mainmenu\">"
                "Validate new users</span></A><br />\n");
 
+       do_template("endbox");
+
+       svprintf("BOXTITLE", WCS_STRING, "Rooms and Floors");
+       do_template("beginbox");
+
        wprintf("<A HREF=\"/display_floorconfig\">"
                "<span class=\"mainmenu\">"
                "Add, change, or delete floors"
-               "</span></A><br />\n");
+               "</span></A>\n");
 
-       wprintf("<A HREF=\"/display_netconf\">"
-               "<span class=\"mainmenu\">"
-               "Configure networking with other systems"
-               "</span></A><br />\n");
-
-       wprintf("<A HREF=\"/display_inetconf\">"
-               "<span class=\"mainmenu\">"
-               "Internet and domain configuration</span></a><br />\n");
+       do_template("endbox");
 
-       wprintf("</td></tr></table></center>");
+       wprintf("</td></tr></table></div>");
        wDumpContent(2);
 }
 
@@ -253,7 +255,8 @@ void display_generic(void)
                "</div>\n<div id=\"content\">\n"
        );
 
-       wprintf("<center><table border=0 width=99%% bgcolor=\"#ffffff\"><tr><td>\n");
+       wprintf("<div id=\"fix_scrollbar_bug\">"
+               "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
        wprintf("<CENTER>");
        wprintf("This screen allows you to enter Citadel server commands which are\n");
@@ -275,7 +278,7 @@ void display_generic(void)
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><br />\n");
 
        wprintf("</FORM></CENTER>\n");
-       wprintf("</td></tr></table></center>\n");
+       wprintf("</td></tr></table></div>\n");
        wDumpContent(1);
 }
 
@@ -294,7 +297,7 @@ void do_generic(void)
        output_headers(1, 1, 0, 0, 0, 0, 0);
 
        serv_printf("%s", bstr("g_cmd"));
-       serv_gets(buf);
+       serv_getln(buf, sizeof buf);
 
        svprintf("BOXTITLE", WCS_STRING, "Server command results");
        do_template("beginbox");
@@ -309,7 +312,7 @@ void do_generic(void)
                serv_printf("\n\n000");
        }
        if ((buf[0] == '1') || (buf[0] == '8')) {
-               while (serv_gets(gcontent), strcmp(gcontent, "000")) {
+               while (serv_getln(gcontent, sizeof gcontent), strcmp(gcontent, "000")) {
                        escputs(gcontent);
                        wprintf("<br />\n");
                }