From 23ebffc89e8465d607725654c64549d184a68b0b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 14 Jul 2004 04:19:57 +0000 Subject: [PATCH] *** empty log message *** --- webcit/inetconf.c | 124 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 86 insertions(+), 38 deletions(-) diff --git a/webcit/inetconf.c b/webcit/inetconf.c index 30125d39a..7ccf7c125 100644 --- a/webcit/inetconf.c +++ b/webcit/inetconf.c @@ -34,23 +34,51 @@ void display_inetconf(void) char buf[SIZ]; char ename[SIZ]; char etype[SIZ]; - - char *ic_localhost; - char *ic_gwdom; - char *ic_directory; - char *ic_spamass; - char *ic_rbl; - char *ic_smarthost; + int i; + int which; + + enum { + ic_localhost, + ic_gwdom, + ic_directory, + ic_spamass, + ic_rbl, + ic_smarthost, + ic_max + }; + char *ic_spec[ic_max]; char *ic_misc; - char *which = NULL; - - ic_localhost = strdup(""); - ic_gwdom = strdup(""); - ic_directory = strdup(""); - ic_spamass = strdup(""); - ic_rbl = strdup(""); - ic_smarthost = strdup(""); + char *ic_keyword[] = { + "localhost", + "gatewaydomain", + "directory", + "spamassassin", + "rbl", + "smarthost" + }; + + char *ic_boxtitle[] = { + "Local host aliases", + "Gateway domains", + "Directory domains", + "SpamAssassin hosts", + "RBL hosts", + "Smart hosts" + }; + + char *ic_desc[] = { + "(domains for which this host receives mail)", + "(domains whose subdomains match Citadel hosts)", + "(domains mapped with the Global Address Book)", + "(hosts running the SpamAssassin service)", + "(hosts running a Realtime Blackhole List)", + "(if present, forward all outbound mail to one of these hosts)" + }; + + for (i=0; i 0) strcat(which, "\n"); - strcat(which, ename); + extract(etype, buf, 1); + which = (-1); + for (i=0; i= 0) { + ic_spec[which] = realloc(ic_spec[which], strlen(ic_spec[which]) + strlen(ename) + 2); + if (strlen(ic_spec[which]) > 0) strcat(ic_spec[which], "\n"); + strcat(ic_spec[which], ename); } else { ic_misc = realloc(ic_misc, strlen(ic_misc) + strlen(buf) + 2); if (strlen(ic_misc) > 0) strcat(ic_misc, "\n"); - strcat(which, buf); + strcat(ic_misc, buf); } - /* FIXME finish this */ - escputs(buf); - wprintf("
\n"); } + wprintf("\n"); + for (which=0; which"); + } + wprintf(""); + if (which % 2 != 0) { + wprintf(""); + } + } + wprintf("
"); + svprintf("BOXTITLE", WCS_STRING, ic_boxtitle[which]); + do_template("beginbox"); + wprintf(""); + escputs(ic_desc[which]); + wprintf("
"); + if (strlen(ic_spec[which]) > 0) { + for (i=0; i\n"); + } + } + wprintf("
(add)
\n"); + do_template("endbox"); + wprintf("
\n"); + wDumpContent(1); - free(ic_localhost); - free(ic_gwdom); - free(ic_directory); - free(ic_spamass); - free(ic_rbl); - free(ic_smarthost); + for (i=0; i