From: Art Cancro Date: Wed, 2 Feb 2000 00:03:52 +0000 (+0000) Subject: * serv_inetcfg: added X-Git-Tag: v7.86~7325 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=49ca0ecf853aa8f070df549099b7eafa16ec91b4;p=citadel.git * serv_inetcfg: added --- diff --git a/citadel/Makefile.in b/citadel/Makefile.in index c526414b2..9e7aacf91 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -28,6 +28,7 @@ SERVER_TARGETS=citserver setup $(CHKPWD) 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 \ @@ -73,7 +74,7 @@ SOURCES=aidepost.c citadel.c citmail.c citserver.c client_chat.c commands.c \ 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) @@ -140,6 +141,12 @@ modules/serv_pop3.so: serv_pop3.mo 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 diff --git a/citadel/serv_inetcfg.c b/citadel/serv_inetcfg.c new file mode 100644 index 000000000..7d7c54aec --- /dev/null +++ b/citadel/serv_inetcfg.c @@ -0,0 +1,86 @@ +/* $Id$ + * + * This module handles the loading/saving and maintenance of the + * system's Internet configuration. + */ + +#include "sysdep.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "citadel.h" +#include "server.h" +#include +#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$"; +} + diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index 91812f4a6..287a993bf 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -67,6 +67,8 @@ long SYM_SMTP_RECP; /*****************************************************************************/ + + /* * Here's where our SMTP session begins its happy day. */ diff --git a/citadel/setup.c b/citadel/setup.c index 9b3a0c2bd..1872eaeaf 100644 --- a/citadel/setup.c +++ b/citadel/setup.c @@ -539,7 +539,6 @@ void set_str_val(int msgpos, char str[]) { char buf[4096]; char tempfile[64]; - char setupmsg[256]; sprintf(tempfile, tmpnam(NULL));