* move policy.c into modules/expire/expire_policy.c, since it just controls this.
authorWilfried Göesgens <willi@citadel.org>
Sat, 24 Apr 2010 09:33:15 +0000 (09:33 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 24 Apr 2010 09:33:15 +0000 (09:33 +0000)
* remove all unneded includes to policy.h
* remove hardcoded reference to policy from mk_module_init.sh (hard to find...)

36 files changed:
citadel/Makefile.in
citadel/citserver.c
citadel/debian/changelog
citadel/modules/clamav/serv_virus.c
citadel/modules/dspam/serv_dspam.c
citadel/modules/expire/expire_policy.c [new file with mode: 0644]
citadel/modules/expire/policy.h [new file with mode: 0644]
citadel/modules/expire/serv_expire.c
citadel/modules/extnotify/extnotify_main.c
citadel/modules/imap/imap_acl.c
citadel/modules/imap/imap_fetch.c
citadel/modules/imap/imap_list.c
citadel/modules/imap/imap_metadata.c
citadel/modules/imap/imap_misc.c
citadel/modules/imap/imap_search.c
citadel/modules/imap/imap_store.c
citadel/modules/imap/serv_imap.c
citadel/modules/inetcfg/serv_inetcfg.c
citadel/modules/listsub/serv_listsub.c
citadel/modules/managesieve/serv_managesieve.c
citadel/modules/mrtg/serv_mrtg.c
citadel/modules/netfilter/serv_netfilter.c
citadel/modules/network/serv_network.c
citadel/modules/newuser/serv_newuser.c
citadel/modules/notes/serv_notes.c
citadel/modules/pop3/serv_pop3.c
citadel/modules/rwho/serv_rwho.c
citadel/modules/sieve/serv_sieve.c
citadel/modules/smtp/serv_smtp.c
citadel/modules/spam/serv_spam.c
citadel/modules/vcard/serv_vcard.c
citadel/modules/wiki/serv_wiki.c
citadel/modules/xmpp/serv_xmpp.c
citadel/policy.c [deleted file]
citadel/policy.h [deleted file]
citadel/scripts/mk_module_init.sh

index 69b598117d3eaf2dc870ad1d33712cc030461058..5c42a103287f876ed1477b466951a28953df2b75 100644 (file)
@@ -84,7 +84,7 @@ SOURCES=utils/aidepost.c utils/stress.c utils/whobbs.c utils/citmail.c \
        citserver.c clientsocket.c config.c control.c $(DATABASE) \
        domain.c serv_extensions.c file_ops.c genstamp.c getutline.c \
        housekeeping.c ical_dezonify.c internet_addressing.c ecrash.c \
-       locate_host.c md5.c auth.c msgbase.c parsedate.c policy.c \
+       locate_host.c md5.c auth.c msgbase.c parsedate.c \
        room_ops.c euidindex.c server_main.c snprintf.c ldap.c \
        support.c sysdep.c user_ops.c journaling.c threads.c \
        context.c
@@ -150,7 +150,7 @@ modules_upgrade.c: modules_init.c
 SERV_OBJS = server_main.o utillib/citadel_dirs.o\
        user_ops.o citserver.o sysdep.o serv_extensions.o \
        $(DATABASE:.c=.o) domain.o \
-       control.o policy.o config.o support.o room_ops.o \
+       control.o config.o support.o room_ops.o \
        file_ops.o msgbase.o euidindex.o \
        locate_host.o housekeeping.o \
        internet_addressing.o journaling.o \
index 603d3498243b8ee3a5b5b263e94b4c1ae3239925..cd13b3e3c297c2e5fd6f8be04c25ed0e55ed5627 100644 (file)
@@ -69,7 +69,6 @@
 #include "locate_host.h"
 #include "room_ops.h"
 #include "file_ops.h"
-#include "policy.h"
 #include "control.h"
 #include "euidindex.h"
 #include "context.h"
index 6624f943752e66134dbdd310e7cfdb3c48e37d70..16c8ad1537a2964f3f521779030e0c4a207b1ca4 100644 (file)
@@ -1,3 +1,9 @@
+citadel (7.79-87) stable; urgency=low
+
+  * beta
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org>  Mon, 22 Dec 2009 22:00:00 +0001
+
 citadel (7.70-87) stable; urgency=low
 
   * new upstream version
index 1553498921dc7331e5c598f6fd52086b88fa7b7a..38b47de84cf1465f5f21a25d369b60b41cff0c7f 100644 (file)
@@ -58,7 +58,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 8285b5368adc7967666dca8645ba21efb79b579b..7d5e4f0cbb77563515a2bdb22a5280ae8dbb2216 100644 (file)
@@ -51,7 +51,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
diff --git a/citadel/modules/expire/expire_policy.c b/citadel/modules/expire/expire_policy.c
new file mode 100644 (file)
index 0000000..260a498
--- /dev/null
@@ -0,0 +1,181 @@
+/* 
+ * $Id$
+ *
+ * Functions which manage policy for rooms (such as message expiry)
+ */
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <string.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
+#include <limits.h>
+#include <libcitadel.h>
+#include "citadel.h"
+#include "server.h"
+#include "database.h"
+#include "config.h"
+#include "room_ops.h"
+#include "sysdep_decls.h"
+#include "support.h"
+#include "user_ops.h"
+#include "msgbase.h"
+#include "citserver.h"
+
+#include "ctdl_module.h"
+
+/*
+ * Retrieve the applicable expire policy for a specific room
+ */
+void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
+       struct floor *fl;
+
+       /* If the room has its own policy, return it */ 
+       if (qrbuf->QRep.expire_mode != 0) {
+               memcpy(epbuf, &qrbuf->QRep, sizeof(struct ExpirePolicy));
+               return;
+       }
+
+       /* (non-mailbox rooms)
+        * If the floor has its own policy, return it
+        */
+       if ( (qrbuf->QRflags & QR_MAILBOX) == 0) {
+               fl = CtdlGetCachedFloor(qrbuf->QRfloor);
+               if (fl->f_ep.expire_mode != 0) {
+                       memcpy(epbuf, &fl->f_ep, sizeof(struct ExpirePolicy));
+                       return;
+               }
+       }
+
+       /* (Mailbox rooms)
+        * If there is a default policy for mailbox rooms, return it
+        */
+       if (qrbuf->QRflags & QR_MAILBOX) {
+               if (config.c_mbxep.expire_mode != 0) {
+                       memcpy(epbuf, &config.c_mbxep,
+                               sizeof(struct ExpirePolicy));
+                       return;
+               }
+       }
+
+       /* Otherwise, fall back on the system default */
+       memcpy(epbuf, &config.c_ep, sizeof(struct ExpirePolicy));
+}
+
+
+/*
+ * Get Policy EXpire
+ */
+void cmd_gpex(char *argbuf) {
+       struct ExpirePolicy exp;
+       struct floor *fl;
+       char which[128];
+
+       extract_token(which, argbuf, 0, '|', sizeof which);
+       if (!strcasecmp(which, strof(room))) {
+               memcpy(&exp, &CC->room.QRep, sizeof(struct ExpirePolicy));
+       }
+       else if (!strcasecmp(which, strof(floorpolicy))) {
+               fl = CtdlGetCachedFloor(CC->room.QRfloor);
+               memcpy(&exp, &fl->f_ep, sizeof(struct ExpirePolicy));
+       }
+       else if (!strcasecmp(which, strof(mailboxespolicy))) {
+               memcpy(&exp, &config.c_mbxep, sizeof(struct ExpirePolicy));
+       }
+       else if (!strcasecmp(which, strof(sitepolicy))) {
+               memcpy(&exp, &config.c_ep, sizeof(struct ExpirePolicy));
+       }
+       else {
+               cprintf("%d Invalid keyword \"%s\"\n", ERROR + ILLEGAL_VALUE, which);
+               return;
+       }
+
+       cprintf("%d %d|%d\n", CIT_OK, exp.expire_mode, exp.expire_value);
+}
+
+
+/*
+ * Set Policy EXpire
+ */
+void cmd_spex(char *argbuf) {
+       struct ExpirePolicy exp;
+       struct floor flbuf;
+       char which[128];
+
+       memset(&exp, 0, sizeof(struct ExpirePolicy));
+       extract_token(which, argbuf, 0, '|', sizeof which);
+       exp.expire_mode = extract_int(argbuf, 1);
+       exp.expire_value = extract_int(argbuf, 2);
+
+       if ((exp.expire_mode < 0) || (exp.expire_mode > 3)) {
+               cprintf("%d Invalid policy.\n", ERROR + ILLEGAL_VALUE);
+               return;
+       }
+
+       if (!strcasecmp(which, "room")) {
+               if (!is_room_aide()) {
+                       cprintf("%d Higher access required.\n",
+                               ERROR + HIGHER_ACCESS_REQUIRED);
+                       return;
+               }
+               CtdlGetRoomLock(&CC->room, CC->room.QRname);
+               memcpy(&CC->room.QRep, &exp, sizeof(struct ExpirePolicy));
+               CtdlPutRoomLock(&CC->room);
+               cprintf("%d Room expire policy has been updated.\n", CIT_OK);
+               return;
+       }
+
+       if (CC->user.axlevel < AxAideU) {
+               cprintf("%d Higher access required.\n",
+                       ERROR + HIGHER_ACCESS_REQUIRED);
+               return;
+       }
+
+       if (!strcasecmp(which, strof(floorpolicy))) {
+               lgetfloor(&flbuf, CC->room.QRfloor);
+               memcpy(&flbuf.f_ep, &exp, sizeof(struct ExpirePolicy));
+               lputfloor(&flbuf, CC->room.QRfloor);
+               cprintf("%d Floor expire policy has been updated.\n", CIT_OK);
+               return;
+       }
+
+       else if (!strcasecmp(which, strof(mailboxespolicy))) {
+               memcpy(&config.c_mbxep, &exp, sizeof(struct ExpirePolicy));
+               put_config();
+               cprintf("%d Default expire policy for mailboxes set.\n",
+                       CIT_OK);
+               return;
+       }
+
+       else if (!strcasecmp(which, strof(sitepolicy))) {
+               if (exp.expire_mode == EXPIRE_NEXTLEVEL) {
+                       cprintf("%d Invalid policy (no higher level)\n",
+                               ERROR + ILLEGAL_VALUE);
+                       return;
+               }
+               memcpy(&config.c_ep, &exp, sizeof(struct ExpirePolicy));
+               put_config();
+               cprintf("%d Site expire policy has been updated.\n", CIT_OK);
+               return;
+       }
+
+       else {
+               cprintf("%d Invalid keyword \"%s\"\n", ERROR + ILLEGAL_VALUE, which);
+               return;
+       }
+
+}
+
diff --git a/citadel/modules/expire/policy.h b/citadel/modules/expire/policy.h
new file mode 100644 (file)
index 0000000..65c8bda
--- /dev/null
@@ -0,0 +1,4 @@
+/* $Id$ */
+void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf);
+void cmd_gpex(char *argbuf);
+void cmd_spex(char *argbuf);
index 8e0cd0077f542b832529dbb48eae687882b5160f..6bdf67068894fb25c67efd1be0d0646081cc6a77 100644 (file)
@@ -1052,6 +1052,9 @@ CTDL_MODULE_INIT(expire)
        {
                /* CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts"); */
                CtdlRegisterProtoHook(cmd_tdap, "TDAP", "Manually initiate auto-purger");
+
+               CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Autoconverted. TODO: document me.");
+               CtdlRegisterProtoHook(cmd_spex, "SPEX", "Autoconverted. TODO: document me.");
        }
        else
                CtdlThreadCreate("Auto Purger", CTDLTHREAD_BIGSTACK, purge_databases, NULL);
index 2b2cdc6482263115af3fb50f1115b82894a3ca16..1734d088d30013283df8571c74db113c568063c4 100644 (file)
@@ -58,7 +58,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index f8e706988bc946ef6520e4e4b43d26fe0b84e2f4..39d8d70e4bb0c378fceb93685b9a23a674f55b16 100644 (file)
@@ -54,7 +54,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index ad175f20434e435acf8537c7b1bf7ecd0eefd7fa..0ee327cb87ade858d3cbeb4d5d34b7f06659ce83 100644 (file)
@@ -55,7 +55,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 75df6a69643963711123a65cccba17e2c6866c40..2c342e94cdfec514fc0b455bf1bab598f156a333 100644 (file)
@@ -53,7 +53,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index b8a8979676476cbc3f631e2190800bca45c0a7a7..09f8022af88fae6e919b76d79d172ab7deba9afe 100644 (file)
@@ -56,7 +56,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 47454b746ffea962751d7b3e6853a21e88b39b0f..04300d8d847c1eef600d63354e4cd0077958f355 100644 (file)
@@ -52,7 +52,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 4972e98e74216341e90a516ff30e70db99edc5e2..e14678e4531e14ebf4b748252ee3bb5b6d4c1ac0 100644 (file)
@@ -57,7 +57,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index c12b6a942a27dde405dc16ed8f6e0e45af85c757..845690df7c613bbcdfbeb443369ce03475bf5f97 100644 (file)
@@ -54,7 +54,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 461cb1737f4148e4369db4fefeded7ca8dd1302d..fd1050538ba8e3b9ace74f2502ecf96198bdea3b 100644 (file)
@@ -56,7 +56,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index cfd72d64f3cb9ba55d03656bc731854475468f0f..051aae3bcb024e3619daa6bdb0a2e164d0b142ce 100644 (file)
@@ -54,7 +54,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 6823260cdfa0856451863ddcf4718cc97266603a..2e1355f55f8ee7bd76f53d6cf180125a9d64b85c 100644 (file)
@@ -53,7 +53,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index da56429ce73439d5d84cdb56ec4bc8904e389b39..5c0e02030a29fbc58c4ac177709d21b06cb0d1cf 100644 (file)
@@ -62,7 +62,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 2ee6f4b23ee22812708d38add97789519aa15dd1..06c1f92cb0f78e3f29ba88257df7458bdd6b08e9 100644 (file)
@@ -56,7 +56,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 
index 19e8f845f56e2e4b795b859a9b3347f12c50d250..a32a0e06c539ff8e5411404dc4119b9513448433 100644 (file)
@@ -52,7 +52,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "serv_network.h"      /* Needed for defenition of FilterList */
index 71f895c48b9b45ab336e04b906013978dd646ee0..84b4a5134c2a02db747dca8d525483def995460e 100644 (file)
@@ -68,7 +68,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 431d433df6ad006f41b9bb996372103695b6ec36..71f89ad636db0ffb91aa47c4fd3dff425d6e2e01 100644 (file)
@@ -60,7 +60,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 
index 9da02a0dbe6963a51e88ccfb29702b72da49b67b..436559a58953245000ef8f50fe4e50f0cb824907 100644 (file)
@@ -51,7 +51,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 
index 5d8ef5ad755e0daf72fe5575b1ad0d0f79fe94fd..107e0366d8a7384cd1da1289e359e56f667227a5 100644 (file)
@@ -62,7 +62,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 6c2c9dc736d895fb5caa44ae2dfa74eb613ac56a..225f003766c254dbfbc6f1dc95df85c58c4171e4 100644 (file)
@@ -53,7 +53,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 
index 8e4d75b7d63b56b21986c6d0c66dd60ed893a915..f8c6e8c3589ac9336788f8d4cb00fa8a33a6c30a 100644 (file)
@@ -51,7 +51,6 @@
 #include "citserver.h"
 #include "support.h"
 #include "config.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 5e5707d2fec31539903dd5045a240ad41f2b1aaf..cfb9b28d7c28b4aa839805040a9c65038cfa25c2 100644 (file)
@@ -76,7 +76,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 5359a1a4babccbfe9eafb60c9db5789ad2cce496..235b0caa318e1e67b788ffdde885186f64eaa7f2 100644 (file)
@@ -58,7 +58,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index 5133fce5449bb7d6382b0bd1b55f69ad496ca57e..fdd41ef64642b837deb1b1eb37ef17aa7de53069 100644 (file)
@@ -69,7 +69,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
index ac65bb1db417a8acd0df668ed765d40fe3cf61e2..1011546cfdded663f6691b530f0d2d95d5f4e7e1 100644 (file)
@@ -53,7 +53,6 @@
 #include "config.h"
 #include "control.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "euidindex.h"
index 0daf9ac022886dd857636e87f26aa1d0bf5e6158..977b6dea4c68a8b8453dde178f2a5176c41c0d46 100644 (file)
@@ -52,7 +52,6 @@
 #include "support.h"
 #include "config.h"
 #include "user_ops.h"
-#include "policy.h"
 #include "database.h"
 #include "msgbase.h"
 #include "internet_addressing.h"
diff --git a/citadel/policy.c b/citadel/policy.c
deleted file mode 100644 (file)
index c85383c..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/* 
- * $Id$
- *
- * Functions which manage policy for rooms (such as message expiry)
- */
-
-#include "sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
-#include <limits.h>
-#include <libcitadel.h>
-#include "citadel.h"
-#include "server.h"
-#include "database.h"
-#include "config.h"
-#include "room_ops.h"
-#include "sysdep_decls.h"
-#include "support.h"
-#include "user_ops.h"
-#include "msgbase.h"
-#include "citserver.h"
-
-#include "ctdl_module.h"
-
-/*
- * Retrieve the applicable expire policy for a specific room
- */
-void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
-       struct floor *fl;
-
-       /* If the room has its own policy, return it */ 
-       if (qrbuf->QRep.expire_mode != 0) {
-               memcpy(epbuf, &qrbuf->QRep, sizeof(struct ExpirePolicy));
-               return;
-       }
-
-       /* (non-mailbox rooms)
-        * If the floor has its own policy, return it
-        */
-       if ( (qrbuf->QRflags & QR_MAILBOX) == 0) {
-               fl = CtdlGetCachedFloor(qrbuf->QRfloor);
-               if (fl->f_ep.expire_mode != 0) {
-                       memcpy(epbuf, &fl->f_ep, sizeof(struct ExpirePolicy));
-                       return;
-               }
-       }
-
-       /* (Mailbox rooms)
-        * If there is a default policy for mailbox rooms, return it
-        */
-       if (qrbuf->QRflags & QR_MAILBOX) {
-               if (config.c_mbxep.expire_mode != 0) {
-                       memcpy(epbuf, &config.c_mbxep,
-                               sizeof(struct ExpirePolicy));
-                       return;
-               }
-       }
-
-       /* Otherwise, fall back on the system default */
-       memcpy(epbuf, &config.c_ep, sizeof(struct ExpirePolicy));
-}
-
-
-/*
- * Get Policy EXpire
- */
-void cmd_gpex(char *argbuf) {
-       struct ExpirePolicy exp;
-       struct floor *fl;
-       char which[128];
-
-       extract_token(which, argbuf, 0, '|', sizeof which);
-       if (!strcasecmp(which, strof(room))) {
-               memcpy(&exp, &CC->room.QRep, sizeof(struct ExpirePolicy));
-       }
-       else if (!strcasecmp(which, strof(floorpolicy))) {
-               fl = CtdlGetCachedFloor(CC->room.QRfloor);
-               memcpy(&exp, &fl->f_ep, sizeof(struct ExpirePolicy));
-       }
-       else if (!strcasecmp(which, strof(mailboxespolicy))) {
-               memcpy(&exp, &config.c_mbxep, sizeof(struct ExpirePolicy));
-       }
-       else if (!strcasecmp(which, strof(sitepolicy))) {
-               memcpy(&exp, &config.c_ep, sizeof(struct ExpirePolicy));
-       }
-       else {
-               cprintf("%d Invalid keyword \"%s\"\n", ERROR + ILLEGAL_VALUE, which);
-               return;
-       }
-
-       cprintf("%d %d|%d\n", CIT_OK, exp.expire_mode, exp.expire_value);
-}
-
-
-/*
- * Set Policy EXpire
- */
-void cmd_spex(char *argbuf) {
-       struct ExpirePolicy exp;
-       struct floor flbuf;
-       char which[128];
-
-       memset(&exp, 0, sizeof(struct ExpirePolicy));
-       extract_token(which, argbuf, 0, '|', sizeof which);
-       exp.expire_mode = extract_int(argbuf, 1);
-       exp.expire_value = extract_int(argbuf, 2);
-
-       if ((exp.expire_mode < 0) || (exp.expire_mode > 3)) {
-               cprintf("%d Invalid policy.\n", ERROR + ILLEGAL_VALUE);
-               return;
-       }
-
-       if (!strcasecmp(which, "room")) {
-               if (!is_room_aide()) {
-                       cprintf("%d Higher access required.\n",
-                               ERROR + HIGHER_ACCESS_REQUIRED);
-                       return;
-               }
-               CtdlGetRoomLock(&CC->room, CC->room.QRname);
-               memcpy(&CC->room.QRep, &exp, sizeof(struct ExpirePolicy));
-               CtdlPutRoomLock(&CC->room);
-               cprintf("%d Room expire policy has been updated.\n", CIT_OK);
-               return;
-       }
-
-       if (CC->user.axlevel < AxAideU) {
-               cprintf("%d Higher access required.\n",
-                       ERROR + HIGHER_ACCESS_REQUIRED);
-               return;
-       }
-
-       if (!strcasecmp(which, strof(floorpolicy))) {
-               lgetfloor(&flbuf, CC->room.QRfloor);
-               memcpy(&flbuf.f_ep, &exp, sizeof(struct ExpirePolicy));
-               lputfloor(&flbuf, CC->room.QRfloor);
-               cprintf("%d Floor expire policy has been updated.\n", CIT_OK);
-               return;
-       }
-
-       else if (!strcasecmp(which, strof(mailboxespolicy))) {
-               memcpy(&config.c_mbxep, &exp, sizeof(struct ExpirePolicy));
-               put_config();
-               cprintf("%d Default expire policy for mailboxes set.\n",
-                       CIT_OK);
-               return;
-       }
-
-       else if (!strcasecmp(which, strof(sitepolicy))) {
-               if (exp.expire_mode == EXPIRE_NEXTLEVEL) {
-                       cprintf("%d Invalid policy (no higher level)\n",
-                               ERROR + ILLEGAL_VALUE);
-                       return;
-               }
-               memcpy(&config.c_ep, &exp, sizeof(struct ExpirePolicy));
-               put_config();
-               cprintf("%d Site expire policy has been updated.\n", CIT_OK);
-               return;
-       }
-
-       else {
-               cprintf("%d Invalid keyword \"%s\"\n", ERROR + ILLEGAL_VALUE, which);
-               return;
-       }
-
-}
-
-/*****************************************************************************/
-/*                      MODULE INITIALIZATION STUFF                          */
-/*****************************************************************************/
-
-CTDL_MODULE_INIT(policy)
-{
-       if (!threading) {
-               CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_spex, "SPEX", "Autoconverted. TODO: document me.");
-       }
-        /* return our Subversion id for the Log */
-       return "$Id$";
-}
diff --git a/citadel/policy.h b/citadel/policy.h
deleted file mode 100644 (file)
index 65c8bda..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $Id$ */
-void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf);
-void cmd_gpex(char *argbuf);
-void cmd_spex(char *argbuf);
index 9ea76c8fdde01b37969e4955d956cd2419af91a7..2d0dc3c03ce6753f808fbb10e194f5ca3dd46131 100755 (executable)
@@ -127,7 +127,6 @@ void initialise_modules (int threading)
         CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(euidindex));
         CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(file_ops));
         CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(msgbase));
-        CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(policy));
         CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(room_ops));
         CtdlLogPrintf (CTDL_INFO, "%s\n", CTDL_INIT_CALL(user_ops));
 /* dynamic modules: */
@@ -155,7 +154,6 @@ void upgrade_modules(void);
        CTDL_MODULE_INIT(euidindex);
        CTDL_MODULE_INIT(file_ops);
        CTDL_MODULE_INIT(msgbase);
-       CTDL_MODULE_INIT(policy);
        CTDL_MODULE_INIT(room_ops);
        CTDL_MODULE_INIT(user_ops);
 EOF