* don't compare the current section via the subst, its in the context-string anyways.
authorWilfried Göesgens <willi@citadel.org>
Sun, 29 Aug 2010 16:57:09 +0000 (16:57 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 29 Aug 2010 16:57:09 +0000 (16:57 +0000)
webcit/siteconfig.c
webcit/static/t/aide/siteconfig/tzsection.html

index 7271690cd5a15e6f2fa78a276b7699197c8c3f8a..25fcfbaae97e84cbdfc4e67b4f454b3c2acfdc3a 100644 (file)
@@ -364,20 +364,21 @@ int ConditionalServCfg(StrBuf *Target, WCTemplputParams *TP)
        else return 0;
 }
 
-int ConditionalServCfgSubst(StrBuf *Target, WCTemplputParams *TP)
+int ConditionalServCfgCTXStrBuf(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
        void *vBuf;
        StrBuf *Buf;
+       StrBuf *ZoneToCheck = (StrBuf*) CTX;
 
-       if (WCC->is_aide) {
+       if ((WCC->is_aide) || (ZoneToCheck == NULL)) {
                if (WCC->ServCfg == NULL)
                        load_siteconfig();
                GetHash(WCC->ServCfg, TKEY(2), &vBuf);
                if (vBuf == NULL) return 0;
                Buf = (StrBuf*) vBuf;
 
-               return CompareSubstToStrBuf(Buf, TP->Tokens->Params[3]);
+               return strcmp(ChrPtr(Buf), ChrPtr(ZoneToCheck)) == 0;
        }
        else return 0;
 }
@@ -390,7 +391,7 @@ InitModule_SITECONFIG
 
        RegisterNamespace("SERV:CFG", 1, 2, tmplput_servcfg, NULL, CTX_NONE);
        RegisterConditional(HKEY("COND:SERVCFG"), 3, ConditionalServCfg, CTX_NONE);
-       RegisterConditional(HKEY("COND:SERVCFG:SUBST"), 4, ConditionalServCfgSubst, CTX_NONE);
+       RegisterConditional(HKEY("COND:SERVCFG:CTXSTRBUF"), 4, ConditionalServCfgCTXStrBuf, CTX_STRBUF);
        RegisterIterator("PREF:ZONE", 0, ZoneHash, NULL, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
 
        REGISTERTokenParamDefine(roompolicy);
index 08ae60e139706cc57342e437c44a739356a1e949..29ef26fe42daa0f14544aa82fa8baf0abeb3b6f7 100644 (file)
@@ -1 +1 @@
-<OPTION <?%("COND:SERVCFG:SUBST", 1, "c_default_cal_zone", "CONTEXTSTR", 'selected="selected"', "")> VALUE='<?CONTEXTSTR>'><?CONTEXTSTR></OPTION>
+<OPTION <?%("COND:SERVCFG:CTXSTRBUF", 1, "c_default_cal_zone", "CONTEXTSTR", 'selected="selected"', "")> VALUE='<?CONTEXTSTR>'><?CONTEXTSTR></OPTION>