[Zope] dtml-if

Chris McDonough chrism@digicool.com
Sun, 5 Dec 1999 17:36:19 -0500


> I can't figure out how to write this simple expression. I am trying to
> compare 2 variable in a dtml-if statement.
> 
> ---variables:
> username: <dtml-var username><br>
> AUTHENTICATED_USER: <dtml-var AUTHENTICATED_USER><br>
> 
> ---output:
> username: dan
> AUTHENTICATED_USER: dan
> 
> ---expression:
> <dtml-if "username == AUTHENTICATED_USER">
> 
> 
> ---evaluates false and I can't figure out why! Have also tried
> <dtml-if "username == REQUEST['AUTHENTICATED_USER']">
> to no avail.

In the if expression you're using (username==ATHENTICATED_USER), you're
comparing an object to a string.  AUTHENTICATED_USER is a Zope object,
not a string.

You want:

<dtml-if "username==AUTHENTICATED_USER.getUserName()">