From: Wilfried Göesgens Date: Thu, 17 Jun 2010 20:38:03 +0000 (+0000) Subject: * ConditionalUserAccess (): don't access the token directly use the access function. X-Git-Tag: v7.86~153 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=6340173518505de7c9f538c69845ff7dd5d0c226 * ConditionalUserAccess (): don't access the token directly use the access function. --- 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; } /*