* ConditionalUserAccess (): don't access the token directly use the access function.
authorWilfried Göesgens <willi@citadel.org>
Thu, 17 Jun 2010 20:38:03 +0000 (20:38 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 17 Jun 2010 20:38:03 +0000 (20:38 +0000)
webcit/useredit.c

index 5eccfdb76ae52e21d16e0647fb71a52f24360676..85e55f43a988491d94886e2bc5b757d2703358a2 100644 (file)
@@ -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;
 }
 
 /*