From a13020d27d4da1dadef0aa333834ce76aeecd923 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 29 Aug 2010 16:57:09 +0000 Subject: [PATCH] * don't compare the current section via the subst, its in the context-string anyways. --- webcit/siteconfig.c | 9 +++++---- webcit/static/t/aide/siteconfig/tzsection.html | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index 7271690cd..25fcfbaae 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -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); diff --git a/webcit/static/t/aide/siteconfig/tzsection.html b/webcit/static/t/aide/siteconfig/tzsection.html index 08ae60e13..29ef26fe4 100644 --- a/webcit/static/t/aide/siteconfig/tzsection.html +++ b/webcit/static/t/aide/siteconfig/tzsection.html @@ -1 +1 @@ - + -- 2.30.2