* Added a "preferences and settings" screen for each user.
authorArt Cancro <ajc@citadel.org>
Fri, 24 Jun 2005 19:58:03 +0000 (19:58 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 24 Jun 2005 19:58:03 +0000 (19:58 +0000)
* Removed the javascript date output stuff because it's not granular
  or international enough.
* All dates and times can now be 12 or 24 hours.

15 files changed:
webcit/ChangeLog
webcit/Makefile.in
webcit/auth.c
webcit/calendar_tools.c
webcit/calendar_view.c
webcit/fmt_date.c [new file with mode: 0644]
webcit/iconbar.c
webcit/mainmenu.c
webcit/messages.c
webcit/preferences.c
webcit/roomops.c
webcit/static/wclib.js
webcit/tools.c
webcit/webcit.c
webcit/webcit.h

index 224ef1a65d0ecd74be765246e5ef3464eaac92c8..3f804065c956c94cd3d9941b0cae155f4b21dbd6 100644 (file)
@@ -1,4 +1,10 @@
 $Log$
+Revision 619.12  2005/06/24 19:58:02  ajc
+* Added a "preferences and settings" screen for each user.
+* Removed the javascript date output stuff because it's not granular
+  or international enough.
+* All dates and times can now be 12 or 24 hours.
+
 Revision 619.11  2005/06/24 15:17:48  ajc
 * The date/time stamp of messages are now output using JavaScript's
   toLocaleString() function, observing the browser's locale and timezone
@@ -2648,4 +2654,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 09f5f833e17acefa7e16e43798c75c2b1dfd92a2..0526a1dd0ee18beb21482ff9803413e46a223b3b 100644 (file)
@@ -37,7 +37,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        mime_parser.o graphics.o netconf.o siteconfig.o subst.o \
        calendar.o calendar_tools.o calendar_view.o event.o \
        availability.o iconbar.o crypto.o inetconf.o notes.o \
-       groupdav_main.o groupdav_get.o groupdav_propfind.o \
+       groupdav_main.o groupdav_get.o groupdav_propfind.o fmt_date.o \
        groupdav_delete.o groupdav_put.o http_datestring.o setup_wizard.o \
        $(LIBOBJS)
        $(CC) webserver.o context_loop.o tools.o cookie_conversion.o \
@@ -48,7 +48,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        summary.o calendar.o calendar_tools.o calendar_view.o event.o \
        availability.o ical_dezonify.o iconbar.o crypto.o inetconf.o notes.o \
        groupdav_main.o groupdav_get.o groupdav_propfind.o groupdav_delete.o \
-       groupdav_put.o http_datestring.o setup_wizard.o \
+       groupdav_put.o http_datestring.o setup_wizard.o fmt_date.o \
        $(LIBOBJS) $(LIBS) $(LDFLAGS) -o webserver
 
 .c.o:
index 1564dbc4cd7834c5820560ac960cd733dd2ab9b0..4ed68ff68efa7e21bf3899b2af6b617248f0c276 100644 (file)
@@ -196,7 +196,7 @@ void do_welcome(void)
        get_preference("startpage", buf, sizeof buf);
        if (strlen(buf)==0) {
                safestrncpy(buf, "/dotskip&room=_BASEROOM_", sizeof buf);
-               set_preference("startpage", buf);
+               set_preference("startpage", buf, 1);
        }
        http_redirect(buf);
 }
index b36497a98c3f86943398931a76dbfeb3d3b7a572..d67ffd1d41017e840d212734043c268fae7fe05e 100644 (file)
@@ -72,6 +72,9 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        struct tm tm;
        const int span = 10;
        int all_day_event = 0;
+       char calhourformat[16];
+
+       get_preference("calhourformat", calhourformat, sizeof calhourformat);
 
        now = time(NULL);
        localtime_r(&now, &tm_now);
@@ -129,10 +132,20 @@ void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        wprintf("Hour: ");
        wprintf("<SELECT NAME=\"%s_hour\" SIZE=\"1\">\n", prefix);
        for (i=0; i<=23; ++i) {
-               wprintf("<OPTION %s VALUE=\"%d\">%s</OPTION>\n",
-                       ((tm.tm_hour == i) ? "SELECTED" : ""),
-                       i, hourname[i]
-               );
+
+               if (!strcasecmp(calhourformat, "24")) {
+                       wprintf("<OPTION %s VALUE=\"%d\">%d</OPTION>\n",
+                               ((tm.tm_hour == i) ? "SELECTED" : ""),
+                               i, i
+                       );
+               }
+               else {
+                       wprintf("<OPTION %s VALUE=\"%d\">%s</OPTION>\n",
+                               ((tm.tm_hour == i) ? "SELECTED" : ""),
+                               i, hourname[i]
+                       );
+               }
+
        }
        wprintf("</SELECT>\n");
 
index 2ebe3b36b682329e5d18e92c94be3c901e28997e..4059bc9a9f690eb9c85205234931d14800c3c7e0 100644 (file)
@@ -315,7 +315,9 @@ void calendar_day_view_display_events(int year, int month,
 void calendar_day_view(int year, int month, int day) {
        int hour;
        struct icaltimetype today, yesterday, tomorrow;
+       char calhourformat[16];
 
+       get_preference("calhourformat", calhourformat, sizeof calhourformat);
 
        /* Figure out the dates for "yesterday" and "tomorrow" links */
 
@@ -365,10 +367,17 @@ void calendar_day_view(int year, int month, int day) {
                        "&year=%d&month=%d&day=%d&hour=%d&minute=0\">",
                        year, month, day, hour
                );
-               wprintf("%d:00%s</A> ",
-                       (hour <= 12 ? hour : hour-12),
-                       (hour < 12 ? "am" : "pm")
-               );
+
+               if (!strcasecmp(calhourformat, "24")) {
+                       wprintf("%2d:00</A> ", hour);
+               }
+               else {
+                       wprintf("%d:00%s</A> ",
+                               (hour <= 12 ? hour : hour-12),
+                               (hour < 12 ? "am" : "pm")
+                       );
+               }
+
                wprintf("</TD><TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
 
                /* put the data here, stupid */
diff --git a/webcit/fmt_date.c b/webcit/fmt_date.c
new file mode 100644 (file)
index 0000000..55b9897
--- /dev/null
@@ -0,0 +1,170 @@
+/*
+ * $Id$
+ *
+ * Miscellaneous routines 
+ */
+
+#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 <sys/time.h>
+#include "webcit.h"
+#include "webserver.h"
+
+typedef unsigned char byte;
+
+#define FALSE 0
+#define TRUE 1
+
+char *ascmonths[] = {
+       "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+char *ascdays[] = {
+       "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+/*
+ * Format a date/time stamp for output 
+ */
+void fmt_date(char *buf, time_t thetime, int brief)
+{
+       struct tm tm;
+       struct tm today_tm;
+       time_t today_timet;
+       int hour;
+       char calhourformat[16];
+
+       get_preference("calhourformat", calhourformat, sizeof calhourformat);
+
+       today_timet = time(NULL);
+       localtime_r(&today_timet, &today_tm);
+
+       localtime_r(&thetime, &tm);
+       hour = tm.tm_hour;
+       if (hour == 0)
+               hour = 12;
+       else if (hour > 12)
+               hour = hour - 12;
+
+       buf[0] = 0;
+
+       if (brief) {
+
+               if ((tm.tm_year == today_tm.tm_year)
+                 &&(tm.tm_mon == today_tm.tm_mon)
+                 &&(tm.tm_mday == today_tm.tm_mday)) {
+                       if (!strcasecmp(calhourformat, "24")) {
+                               sprintf(buf, "%2d:%02d",
+                                       tm.tm_hour, tm.tm_min
+                               );
+                       }
+                       else {
+                               sprintf(buf, "%2d:%02d%s",
+                                       hour, tm.tm_min,
+                                       ((tm.tm_hour >= 12) ? "pm" : "am")
+                               );
+                       }
+               }
+               else {
+                       sprintf(buf, "%s %d %d",
+                               ascmonths[tm.tm_mon],
+                               tm.tm_mday,
+                               tm.tm_year + 1900
+                       );
+               }
+       }
+       else {
+               if (!strcasecmp(calhourformat, "24")) {
+                       sprintf(buf, "%s %d %d %2d:%02d",
+                               ascmonths[tm.tm_mon],
+                               tm.tm_mday,
+                               tm.tm_year + 1900,
+                               tm.tm_hour, tm.tm_min
+                       );
+               }
+               else {
+                       sprintf(buf, "%s %d %d %2d:%02d%s",
+                               ascmonths[tm.tm_mon],
+                               tm.tm_mday,
+                               tm.tm_year + 1900,
+                               hour, tm.tm_min, ((tm.tm_hour >= 12) ? "pm" : "am")
+                       );
+               }
+       }
+}
+
+
+
+/*
+ * Format TIME ONLY for output 
+ */
+void fmt_time(char *buf, time_t thetime)
+{
+       struct tm *tm;
+       int hour;
+       char calhourformat[16];
+
+       get_preference("calhourformat", calhourformat, sizeof calhourformat);
+
+       buf[0] = 0;
+       tm = localtime(&thetime);
+       hour = tm->tm_hour;
+       if (hour == 0)
+               hour = 12;
+       else if (hour > 12)
+               hour = hour - 12;
+
+       if (!strcasecmp(calhourformat, "24")) {
+               sprintf(buf, "%2d:%02d",
+                       tm->tm_hour, tm->tm_min
+               );
+       }
+       else {
+               sprintf(buf, "%d:%02d%s",
+                       hour, tm->tm_min, ((tm->tm_hour > 12) ? "pm" : "am")
+               );
+       }
+}
+
+
+
+
+/*
+ * Format a date/time stamp to the format used in HTTP headers
+ */
+void httpdate(char *buf, time_t thetime)
+{
+       struct tm *tm;
+
+       buf[0] = 0;
+       tm = localtime(&thetime);
+
+       sprintf(buf, "%s, %02d %s %4d %02d:%02d:%02d",
+               ascdays[tm->tm_wday],
+               tm->tm_mday,
+               ascmonths[tm->tm_mon],
+               tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec);
+}
+
+
+
+
+
index 7341a10325808d5120f1bf6e31fd7666f7b150df..5cd42c8ede66051f90c85e0fa915cbce9866aaff 100644 (file)
@@ -608,7 +608,7 @@ void commit_iconbar(void) {
                }
        }
 
-       set_preference("iconbar", iconbar);
+       set_preference("iconbar", iconbar, 1);
 
        output_headers(1, 1, 0, 0, 0, 0, 0);
        wprintf(
index f8b9a6ddbfff98718aa02370cdfb48e10529eb80..5eea557eb2fa7be5ca359ce1709d081938f5b192 100644 (file)
@@ -136,9 +136,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\">"
index 6e4890d54971f61ce3f27efc03571b40d76afbe8..908a871a08ce8e20873df8d294abf73114a116c8 100644 (file)
@@ -416,6 +416,7 @@ void read_message(long msgnum) {
        char node[SIZ];
        char rfca[SIZ];
        char reply_to[512];
+       char now[SIZ];
        int format_type = 0;
        int nhdr = 0;
        int bq = 0;
@@ -499,9 +500,8 @@ void read_message(long msgnum) {
                if (!strncasecmp(buf, "rcpt=", 5))
                        wprintf("to %s ", &buf[5]);
                if (!strncasecmp(buf, "time=", 5)) {
-                       wprintf("<script type=\"text/javascript\">"
-                               "output_datetime(%s);"
-                               "</script> ", &buf[5]);
+                       fmt_date(now, atol(&buf[5]), 0);
+                       wprintf("%s ", now);
                }
 
                if (!strncasecmp(buf, "part=", 5)) {
@@ -1663,7 +1663,7 @@ void display_enter(void)
        }
 
        now = time(NULL);
-       strcpy(buf, "");
+       fmt_date(buf, now, 0);
        strcat(&buf[strlen(buf)], " <I>from</I> ");
        stresc(&buf[strlen(buf)], WC->wc_username, 1, 1);
        if (strlen(bstr("recp")) > 0) {
@@ -1686,11 +1686,7 @@ void display_enter(void)
        wprintf("<input type=\"hidden\" name=\"postseq\" value=\"%ld\">\n",
                now);
 
-       /* header bar */
-       wprintf("<script type=\"text/javascript\">"
-               "output_datetime(%ld);"
-               "</script> ", now);
-       wprintf("%s<br>\n", buf);
+       wprintf("%s<br>\n", buf);       /* header bar */
        wprintf("<img src=\"static/enter.gif\" align=middle alt=\" \">");
                /* "onLoad=\"document.enterform.msgtext.focus();\" " */
        wprintf("<font size=-1>Subject (optional):</font>"
index eab5f8cdd639bdec7c54370263e7139301807841..1c51b9844c164f55d8641496777be39cf7f621ef 100644 (file)
@@ -150,7 +150,7 @@ void get_preference(char *key, char *value, size_t value_len) {
        }
 }
 
-void set_preference(char *key, char *value) {
+void set_preference(char *key, char *value, int save_to_server) {
        int num_prefs;
        int i;
        char buf[SIZ];
@@ -180,5 +180,100 @@ void set_preference(char *key, char *value) {
        free(WC->preferences);
        WC->preferences = newprefs;
 
-       save_preferences();
+       if (save_to_server) save_preferences();
+}
+
+
+
+
+/* 
+ * display form for changing your preferences and settings
+ */
+void display_preferences(void)
+{
+       output_headers(1, 1, 2, 0, 0, 0, 0);
+       char buf[256];
+
+       wprintf("<div id=\"banner\">\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
+       wprintf("<IMG SRC=\"/static/advanpage2_48x.gif\" ALT=\" \" ALIGN=MIDDLE>");
+       wprintf("<SPAN CLASS=\"titlebar\">&nbsp;Preferences and settings");
+       wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
+       offer_start_page();
+       wprintf("</TD></TR></TABLE>\n");
+       wprintf("</div>\n"
+               "<div id=\"content\">\n");
+
+       wprintf("<div id=\"fix_scrollbar_bug\">"
+               "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
+
+       /* begin form */
+       wprintf("<center>\n"
+               "<form name=\"prefform\" action=\"set_preferences\" "
+               "method=\"post\">\n"
+               "<table border=0 cellspacing=5 cellpadding=5>\n");
+
+
+       get_preference("roomlistview", buf, sizeof buf);
+       wprintf("<tr><td>Room list view</td><td>");
+
+       wprintf("<input type=\"radio\" name=\"roomlistview\" VALUE=\"folders\"");
+       if (!strcasecmp(buf, "folders")) wprintf(" checked");
+       wprintf(">Tree (folders) view<br></input>\n");
+
+       wprintf("<input type=\"radio\" name=\"roomlistview\" VALUE=\"rooms\"");
+       if (!strcasecmp(buf, "rooms")) wprintf(" checked");
+       wprintf(">Table (rooms) view<br></input>\n");
+
+       wprintf("</td></tr>\n");
+
+
+       get_preference("calhourformat", buf, sizeof buf);
+       if (buf[0] == 0) strcpy(buf, "12");
+       wprintf("<tr><td>Calendar hour format</td><td>");
+
+       wprintf("<input type=\"radio\" name=\"calhourformat\" VALUE=\"12\"");
+       if (!strcasecmp(buf, "12")) wprintf(" checked");
+       wprintf(">12 hour (am/pm)<br></input>\n");
+
+       wprintf("<input type=\"radio\" name=\"calhourformat\" VALUE=\"24\"");
+       if (!strcasecmp(buf, "24")) wprintf(" checked");
+       wprintf(">24 hour<br></input>\n");
+
+       wprintf("</td></tr>\n");
+
+       wprintf("</table>\n"
+               "<input type=\"submit\" name=\"action\" value=\"Change\">"
+               "&nbsp;"
+               "<INPUT type=\"submit\" name=\"action\" value=\"Cancel\">\n");
+
+       wprintf("</form></center>\n");
+
+       /* end form */
+
+
+       wprintf("</td></tr></table></div>\n");
+       wDumpContent(1);
+}
+
+/*
+ * Commit new preferences and settings
+ */
+void set_preferences(void)
+{
+       if (strcmp(bstr("action"), "Change")) {
+               safestrncpy(WC->ImportantMessage, 
+                       "Cancelled.  No settings were changed.",
+                       sizeof WC->ImportantMessage);
+               display_main_menu();
+               return;
+       }
+
+       /* Set the last argument to 1 only for the final setting, so
+        * we don't send the prefs file to the server repeatedly
+        */
+       set_preference("roomlistview", bstr("roomlistview"), 0);
+       set_preference("calhourformat", bstr("calhourformat"), 1);
+
+       display_main_menu();
 }
index f61670f4c89d169b4ffe4310f0a32ca39e89dc79..69ff9461e090913e9df48b4efa82e07fd74ad06f 100644 (file)
@@ -2588,7 +2588,7 @@ void knrooms() {
        /* Determine whether the user is trying to change views */
        if (bstr("view") != NULL) {
                if (strlen(bstr("view")) > 0) {
-                       set_preference("roomlistview", bstr("view"));
+                       set_preference("roomlistview", bstr("view"), 1);
                }
        }
 
index 25ca7d6dc8f82a8d9e5b127af42ae60db3e5a135..014a8ef661c0c652f0cd3ee33b00f4403e7f8c4f 100644 (file)
@@ -28,11 +28,3 @@ function hide_page_popup() {
 document.poppedLayer.style.visibility = "hidden";
 }
 
-
-// Given a unix timestamp, outputs a date/time using the browser's
-// timezone and locale.
-function output_datetime(unixtimestamp) {
-       var now = new Date();
-       now.setTime(unixtimestamp * 1000);
-       document.write(now.toLocaleString());
-}
index 149f48d3fe0c4a123b8f9eb7e26ef6760f7bab56..d85e47ed7328b2bc55084ab6f18332abe80c1015 100644 (file)
@@ -32,15 +32,6 @@ typedef unsigned char byte;
 #define FALSE 0
 #define TRUE 1
 
-char *ascmonths[] = {
-       "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-};
-
-char *ascdays[] = {
-       "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
-};
-
 static byte dtable[256];       /* base64 encode / decode table */
 
 char *safestrncpy(char *dest, const char *src, size_t n)
@@ -192,103 +183,6 @@ char ch;
 }
 
 
-/*
- * Format a date/time stamp for output 
- */
-void fmt_date(char *buf, time_t thetime, int brief)
-{
-       struct tm tm;
-       struct tm today_tm;
-       time_t today_timet;
-       int hour;
-
-       today_timet = time(NULL);
-       localtime_r(&today_timet, &today_tm);
-
-       localtime_r(&thetime, &tm);
-       hour = tm.tm_hour;
-       if (hour == 0)
-               hour = 12;
-       else if (hour > 12)
-               hour = hour - 12;
-
-       buf[0] = 0;
-
-       if (brief) {
-
-               if ((tm.tm_year == today_tm.tm_year)
-                 &&(tm.tm_mon == today_tm.tm_mon)
-                 &&(tm.tm_mday == today_tm.tm_mday)) {
-                       sprintf(buf, "%2d:%02d%s",
-                               hour, tm.tm_min,
-                               ((tm.tm_hour >= 12) ? "pm" : "am")
-                       );
-               }
-               else {
-                       sprintf(buf, "%s %d %d",
-                               ascmonths[tm.tm_mon],
-                               tm.tm_mday,
-                               tm.tm_year + 1900
-                       );
-               }
-       }
-       else {
-               sprintf(buf, "%s %d %d %2d:%02d%s",
-                       ascmonths[tm.tm_mon],
-                       tm.tm_mday,
-                       tm.tm_year + 1900,
-                       hour, tm.tm_min, ((tm.tm_hour >= 12) ? "pm" : "am")
-               );
-       }
-}
-
-
-
-/*
- * Format TIME ONLY for output 
- */
-void fmt_time(char *buf, time_t thetime)
-{
-       struct tm *tm;
-       int hour;
-
-       buf[0] = 0;
-       tm = localtime(&thetime);
-       hour = tm->tm_hour;
-       if (hour == 0)
-               hour = 12;
-       else if (hour > 12)
-               hour = hour - 12;
-
-       sprintf(buf, "%d:%02d%s",
-               hour, tm->tm_min, ((tm->tm_hour > 12) ? "pm" : "am")
-           );
-}
-
-
-
-
-/*
- * Format a date/time stamp to the format used in HTTP headers
- */
-void httpdate(char *buf, time_t thetime)
-{
-       struct tm *tm;
-
-       buf[0] = 0;
-       tm = localtime(&thetime);
-
-       sprintf(buf, "%s, %02d %s %4d %02d:%02d:%02d",
-               ascdays[tm->tm_wday],
-               tm->tm_mday,
-               ascmonths[tm->tm_mon],
-               tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec);
-}
-
-
-
-
-
 /*
  * Utility function to "readline" from memory
  * (returns new pointer)
index f1190b8f5a0d8cf5b157aac41f7c026c3fbf5537..57ecff156676d27dd4cec4f87f45b455f90e484f 100644 (file)
@@ -762,7 +762,7 @@ void change_start_page(void) {
                return;
        }
 
-       set_preference("startpage", bstr("startpage"));
+       set_preference("startpage", bstr("startpage"), 1);
 
        output_headers(1, 1, 0, 0, 0, 0, 0);
        do_template("newstartpage");
@@ -1359,6 +1359,10 @@ void session_loop(struct httprequest *req)
                save_inetconf();
        } else if (!strcasecmp(action, "setup_wizard")) {
                do_setup_wizard();
+       } else if (!strcasecmp(action, "display_preferences")) {
+               display_preferences();
+       } else if (!strcasecmp(action, "set_preferences")) {
+               set_preferences();
        } else if (!strcasecmp(action, "diagnostics")) {
                output_headers(1, 1, 1, 0, 0, 0, 0);
 
index 6300e23fe5d69305ba0ed33f28e119a759ccdbbe..24ee4dfc3f115244a73dd5b22fd8ec8c8f184dde 100644 (file)
@@ -419,7 +419,7 @@ void do_stuff_to_msgs(void);
 void load_preferences(void);
 void save_preferences(void);
 void get_preference(char *key, char *value, size_t value_len);
-void set_preference(char *key, char *value);
+void set_preference(char *key, char *value, int save_to_server);
 void knrooms(void);
 int is_msg_in_mset(char *mset, long msgnum);
 char *safestrncpy(char *dest, const char *src, size_t n);
@@ -452,7 +452,8 @@ void set_room_policy(void);
 void display_inetconf(void);
 void save_inetconf(void);
 void generate_uuid(char *);
-
+void display_preferences(void);
+void set_preferences(void);
 
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
 void display_edit_task(void);