From 6340173518505de7c9f538c69845ff7dd5d0c226 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 17 Jun 2010 20:38:03 +0000 Subject: [PATCH] * ConditionalUserAccess (): don't access the token directly use the access function. --- webcit/useredit.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/webcit/useredit.c b/webcit/useredit.c index 5eccfdb76..85e55f43a 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -391,11 +391,16 @@ int ConditionalFlagINetEmail(StrBuf *Target, WCTemplputParams *TP) int ConditionalUserAccess(StrBuf *Target, WCTemplputParams *TP) { UserListEntry *ul = (UserListEntry*) CTX; - - if (TP->Tokens->Params[3]->Type == TYPE_LONG) - return (TP->Tokens->Params[3]->lvalue == ul->AccessLevel); - else + + if (ul == NULL) return 0; + + return GetTemplateTokenNumber(Target, + TP, + 3, + AxNewU) + == + ul->AccessLevel; } /* -- 2.30.2