3 * This module handles the loading/saving and maintenance of the
4 * system's Internet configuration.
15 #include <sys/types.h>
23 #include "sysdep_decls.h"
24 #include "citserver.h"
27 #include "dynloader.h"
34 #include "internet_addressing.h"
40 * This handler detects changes being made to the system's Internet
43 int inetcfg_aftersave(struct CtdlMessage *msg) {
47 /* If this isn't the configuration room, or if this isn't a MIME
48 * message, don't bother.
50 if (strcasecmp(msg->cm_fields['O'], SYSCONFIGROOM)) return(0);
51 if (msg->cm_format_type != 4) return(0);
53 ptr = msg->cm_fields['M'];
56 linelen = strcspn(ptr, "\n");
57 if (linelen == 0) return(0); /* end of headers */
59 if ( (!strncasecmp(ptr, "Content-type: ", 14))
60 && (!strncasecmp(&ptr[14], INTERNETCFG,
61 strlen(INTERNETCFG) )) ) {
62 /* Bingo! The user is changing configs.
64 lprintf(9, "Internet configuration changed FIX\n");
67 ptr = strchr((char *)ptr, '\n');
68 if (ptr != NULL) ++ptr;
76 /*****************************************************************************/
77 /* MODULE INITIALIZATION STUFF */
78 /*****************************************************************************/
81 char *Dynamic_Module_Init(void)
83 CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE);