fix dlen
[citadel.git] / webcit / siteconfig.c
index 2d5755b4305629c6af50cb145deca0bbfba5ed1a..39e90e614e43a312690b9aeb4bf139f526d6b38f 100644 (file)
@@ -1,19 +1,14 @@
 /*
  * Administrative screen for site-wide configuration
  *
- * Copyright (c) 1996-2021 by the citadel.org team
+ * Copyright (c) 1996-2024 by the citadel.org team
  *
- * This program is open source software.  You can redistribute it and/or
- * modify it under the terms of the GNU General Public License, version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * This program is open source software.  Use, duplication, or disclosure
+ * are subject to the terms of the GNU General Public License version 3.
  */
 
 #include "webcit.h"
-#include "webserver.h"
+
 
 /*
  * Expiry policy for the autopurger
@@ -36,8 +31,8 @@ ConstStr ExpirePolicyStrings[][2] = {
        { { CStrOf(mailboxespolicy)} , { strof(mailboxespolicy)"_value", sizeof(strof(mailboxespolicy)"_value") - 1 } }
 };
 
-void LoadExpirePolicy(GPEXWhichPolicy which)
-{
+
+void LoadExpirePolicy(GPEXWhichPolicy which) {
        StrBuf *Buf;
        long State;
        const char *Pos = NULL;
@@ -55,8 +50,8 @@ void LoadExpirePolicy(GPEXWhichPolicy which)
        FreeStrBuf(&Buf);
 }
 
-void SaveExpirePolicyFromHTTP(GPEXWhichPolicy which)
-{
+
+void SaveExpirePolicyFromHTTP(GPEXWhichPolicy which) {
        StrBuf *Buf;
        long State;
 
@@ -73,8 +68,8 @@ void SaveExpirePolicyFromHTTP(GPEXWhichPolicy which)
        FreeStrBuf(&Buf);
 }
 
-int ConditionalExpire(StrBuf *Target, WCTemplputParams *TP)
-{
+
+int ConditionalExpire(StrBuf *Target, WCTemplputParams *TP) {
        GPEXWhichPolicy which;
        int CompareWith;
 
@@ -86,8 +81,8 @@ int ConditionalExpire(StrBuf *Target, WCTemplputParams *TP)
        return WC->Policy[which].expire_mode == CompareWith;
 }
 
-void tmplput_ExpireValue(StrBuf *Target, WCTemplputParams *TP)
-{
+
+void tmplput_ExpireValue(StrBuf *Target, WCTemplputParams *TP) {
        GPEXWhichPolicy which;
                
        which = GetTemplateTokenNumber(Target, TP, 0, 0);
@@ -96,8 +91,7 @@ void tmplput_ExpireValue(StrBuf *Target, WCTemplputParams *TP)
 }
 
 
-void tmplput_ExpireMode(StrBuf *Target, WCTemplputParams *TP)
-{
+void tmplput_ExpireMode(StrBuf *Target, WCTemplputParams *TP) {
        GPEXWhichPolicy which;
                
        which = GetTemplateTokenNumber(Target, TP, 2, 0);
@@ -106,8 +100,7 @@ void tmplput_ExpireMode(StrBuf *Target, WCTemplputParams *TP)
 }
 
 
-void LoadZoneFiles(void)
-{
+void LoadZoneFiles(void) {
        icalarray *zones;
        int z;
        long len;
@@ -218,16 +211,15 @@ CfgMapping ServerConfig[] = {
        {CFG_STR, 0, 0, "", HKEY("c_port_number")},
        {CFG_STR, 0, 0, "", HKEY("c_ctdluid")},
        {CFG_STR, 0, 0, "", HKEY("c_nntp_port")},
-       {CFG_STR, 0, 0, "", HKEY("c_nntps_port")}
+       {CFG_STR, 0, 0, "", HKEY("c_nntps_port")},
+       {CFG_YES, 0, 0, "", HKEY("smtp_advertise_starttls")}
 };
 
 
-
 /*
  *  display all configuration items
  */
-void load_siteconfig(void)
-{
+void load_siteconfig(void) {
        StrBuf *Buf;
        HashList *Cfg;
        long len;
@@ -279,12 +271,10 @@ void load_siteconfig(void)
 }
 
 
-
 /*
  * parse siteconfig changes 
  */
-void siteconfig(void)
-{
+void siteconfig(void) {
        int i, value;
        StrBuf *Line;
 
@@ -345,8 +335,7 @@ void siteconfig(void)
 
 
 // if WebCit Classic wasn't obsolete we would replace this with a "CONF GETVAL" type of thing
-void tmplput_servcfg(StrBuf *Target, WCTemplputParams *TP)
-{
+void tmplput_servcfg(StrBuf *Target, WCTemplputParams *TP) {
        void *vBuf;
        StrBuf *Buf;
 
@@ -359,24 +348,8 @@ void tmplput_servcfg(StrBuf *Target, WCTemplputParams *TP)
        }
 }
 
-// output the global alias table
-void tmplput_servcfg_globalaliases(StrBuf *Target, WCTemplputParams *TP) {
-       TRACE;
-       StrBufAppendTemplate(Target, TP, "wow\n", 0);
-       TRACE;
-}
-
-
-
-
 
-
-
-
-
-
-int ConditionalServCfg(StrBuf *Target, WCTemplputParams *TP)
-{
+int ConditionalServCfg(StrBuf *Target, WCTemplputParams *TP) {
        void *vBuf;
        StrBuf *Buf;
 
@@ -406,8 +379,7 @@ int ConditionalServCfg(StrBuf *Target, WCTemplputParams *TP)
        else return 0;
 }
 
-int ConditionalServCfgCTXStrBuf(StrBuf *Target, WCTemplputParams *TP)
-{
+int ConditionalServCfgCTXStrBuf(StrBuf *Target, WCTemplputParams *TP) {
        void *vBuf;
        StrBuf *Buf;
        StrBuf *ZoneToCheck = (StrBuf*) CTX(CTX_STRBUF);
@@ -501,7 +473,6 @@ InitModule_SITECONFIG
        WebcitAddUrlHandler(HKEY("siteconfig"), "", 0, siteconfig, CTX_NONE);
 
        RegisterNamespace("SERV:CFG", 1, 2, tmplput_servcfg, NULL, CTX_NONE);
-       RegisterNamespace("SERV:GLOBALALIASES", 0, 1, tmplput_servcfg_globalaliases, NULL, CTX_NONE);
        RegisterConditional("COND:SERVCFG", 3, ConditionalServCfg, CTX_NONE);
        RegisterConditional("COND:SERVCFG:CTXSTRBUF", 4, ConditionalServCfgCTXStrBuf, CTX_STRBUF);
        RegisterIterator("PREF:ZONE", 0, ZoneHash, NULL, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG);