X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Fcontext_loop.c;h=4cf0b5bfee7ee265d8444d283bec75d3e1ec5b79;hp=e505b5465d00606e231372d2e7433c9ded6a035b;hb=48b40c677af024cbf96a4e63a8deb68be484d785;hpb=3f3310ae5f3e42f714550f26e167ffea11005083 diff --git a/webcit/context_loop.c b/webcit/context_loop.c index e505b5465..4cf0b5bfe 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -553,3 +553,17 @@ void context_loop(int *sock) } + +void tmpl_nonce(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context) +{ + struct wcsession *WCC = WC; + StrBufAppendPrintf(Target, "%ld", + (WCC != NULL)? WCC->nonce:0); +} + +void +InitModule_CONTEXT +(void) +{ + RegisterNamespace("NONCE", 0, 0, tmpl_nonce); +}