SERV_MODULES=modules/serv_chat$(SO) modules/serv_vcard$(SO) \
modules/serv_upgrade$(SO) \
modules/serv_smtp$(SO) modules/serv_pop3$(SO) \
+ modules/serv_inetcfg$(SO) \
modules/serv_expire$(SO) $(SERV_ICQ)
UTIL_TARGETS=aidepost netmailer netproc netsetup msgform readlog rcit \
stats citmail netpoll mailinglist userlist sendcommand \
whobbs.c sendcommand.c mime_parser.c base64.c qpdecode.c getutline.c \
auth.c chkpwd.c client_icq.c html.c vcard.c serv_upgrade.c \
serv_smtp.c serv_pop3.c internet_addressing.c parsedate.c genstamp.c \
- domain.c clientsocket.c
+ domain.c clientsocket.c serv_inetcfg.c
DEP_FILES=$(SOURCES:.c=.d)
modules/serv_pop3.mo: serv_pop3.mo
ln -f serv_pop3.mo modules
+modules/serv_inetcfg.so: serv_inetcfg.mo
+ $(LINK_SHARED) -o modules/serv_inetcfg.so serv_inetcfg.mo
+
+modules/serv_inetcfg.mo: serv_inetcfg.mo
+ ln -f serv_inetcfg.mo modules
+
modules/serv_expire.so: serv_expire.mo
$(LINK_SHARED) -o modules/serv_expire.so serv_expire.mo
--- /dev/null
+/* $Id$
+ *
+ * This module handles the loading/saving and maintenance of the
+ * system's Internet configuration.
+ */
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <string.h>
+#include <limits.h>
+#include "citadel.h"
+#include "server.h"
+#include <time.h>
+#include "sysdep_decls.h"
+#include "citserver.h"
+#include "support.h"
+#include "config.h"
+#include "dynloader.h"
+#include "room_ops.h"
+#include "user_ops.h"
+#include "policy.h"
+#include "database.h"
+#include "msgbase.h"
+#include "tools.h"
+#include "internet_addressing.h"
+#include "genstamp.h"
+#include "domain.h"
+
+
+/*
+ * This handler detects changes being made to the system's Internet
+ * configuration.
+ */
+int inetcfg_aftersave(struct CtdlMessage *msg) {
+ char *ptr;
+ int linelen;
+
+ /* If this isn't the configuration room, or if this isn't a MIME
+ * message, don't bother.
+ */
+ if (strcasecmp(msg->cm_fields['O'], SYSCONFIGROOM)) return(0);
+ if (msg->cm_format_type != 4) return(0);
+
+ ptr = msg->cm_fields['M'];
+ while (ptr != NULL) {
+
+ linelen = strcspn(ptr, "\n");
+ if (linelen == 0) return(0); /* end of headers */
+
+ if ( (!strncasecmp(ptr, "Content-type: ", 14))
+ && (!strncasecmp(&ptr[14], INTERNETCFG,
+ strlen(INTERNETCFG) )) ) {
+ /* Bingo! The user is changing configs.
+ */
+ lprintf(9, "Internet configuration changed FIX\n");
+ }
+
+ ptr = strchr((char *)ptr, '\n');
+ if (ptr != NULL) ++ptr;
+ }
+
+ return(0);
+}
+
+
+
+/*****************************************************************************/
+/* MODULE INITIALIZATION STUFF */
+/*****************************************************************************/
+
+
+char *Dynamic_Module_Init(void)
+{
+ CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE);
+ return "$Id$";
+}
+