/*
* Administrative screen for site-wide configuration
+ *
+ * Copyright (c) 1996-2012 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.
*/
-
#include "webcit.h"
#include "webserver.h"
-
HashList *ZoneHash = NULL;
ConstStr ExpirePolicyString = {CStrOf(roompolicy) };
}
-
void LoadZoneFiles(void)
{
icalarray *zones;
int type;
const char *Key;
long len;
-}CfgMapping;
+} CfgMapping;
#define CFG_STR 1
#define CFG_YES 2
{CFG_STR, HKEY("c_xmpp_s2s_port")},
{CFG_STR, HKEY("c_pop3_fetch")},
{CFG_STR, HKEY("c_pop3_fastest")},
- {CFG_YES , HKEY("c_spam_flag_only")},
- {CFG_YES , HKEY("c_guest_logins")}
+ {CFG_YES, HKEY("c_spam_flag_only")},
+ {CFG_YES, HKEY("c_guest_logins")}
};
+
/*
* display all configuration items
*/
StrBuf *Buf;
HashList *Cfg;
long len;
- int i;
+ int i, j;
if (WCC->ServCfg == NULL)
WCC->ServCfg = NewHash(1, NULL);
if (GetServerStatus(Buf, NULL) != 1) {
StrBufCutLeft(Buf, 4);
AppendImportantMessage(SKEY(Buf));
+ FreeStrBuf(&Buf);
return;
}
- i = 0;
+ j = i = 0;
while (len = StrBuf_ServGetln(Buf),
(len >= 0) &&
- (i <= (sizeof(ServerConfig) / sizeof(CfgMapping))) &&
((len != 3) || strcmp(ChrPtr(Buf), "000")))
{
- Put(Cfg,
- ServerConfig[i].Key,
- ServerConfig[i].len,
- Buf,
- HFreeStrBuf);
- i++;
- if (i <= sizeof(ServerConfig) / sizeof(CfgMapping))
+ if (i < (sizeof(ServerConfig) / sizeof(CfgMapping)))
+ {
+ Put(Cfg,
+ ServerConfig[i].Key,
+ ServerConfig[i].len,
+ Buf,
+ HFreeStrBuf);
+ i++;
Buf = NewStrBuf();
- else
- Buf = NULL;
- }
- if (strcmp(ChrPtr(Buf), "000")!=0)
- {
- /* WHOOOOPSI??? burn the lines we don't understand */
- while ((len = StrBuf_ServGetln(Buf),
- strcmp(ChrPtr(Buf), "000"))) {}
- AppendImportantMessage(_("WARNING: Failed to parse Server Config; do you run a to new citserver?"), -1);
- return;
+ }
+ else {
+ if (j == 0)
+ AppendImportantMessage(_("WARNING: Failed to parse Server Config; do you run a to new citserver?"), -1);
+ j++;
+ }
}
FreeStrBuf(&Buf);
-/**
+/*
* parse siteconfig changes
*/
void siteconfig(void)