Check to see if someone is a user, or anonymous
what is the easiest way to find out if someone has logged in? I want to print some content on a page and have found a way to tie content to roles, but not to print only for anonymous users.
<dtml-if "REQUEST.has_key('AUTHENTICATED_USER')"> -jfarr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Hi! I'm a signature virus. Copy me into your .sig to join the fun! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ----- Original Message ----- From: Baker, Dennis (sjmr) <DBaker@CHW.edu> To: <zope@zope.org> Sent: Thursday, March 23, 2000 2:16 PM Subject: [Zope] Check to see if someone is a user, or anonymous
what is the easiest way to find out if someone has logged in? I want to print some content on a page and have found a way to tie content to roles, but not to print only for anonymous users.
Jonothan Farr wrote:
<dtml-if "REQUEST.has_key('AUTHENTICATED_USER')">
or rather <dtml-if "AUTHENTICATED_USER.getUserName()!='Anonymous'"> as in: <dtml-if "AUTHENTICATED_USER.getUserName()!='Anonymous'"> whatever <dtml-else> whatever else </dtml-if> Rik
Doh! Thanks for the correction. -jfarr ----- Original Message ----- From: Rik Hoekstra <rik.hoekstra@inghist.nl> To: Jonothan Farr <jfarr@real.com> Cc: Baker, Dennis (sjmr) <DBaker@CHW.edu>; <zope@zope.org> Sent: Friday, March 24, 2000 1:46 AM Subject: Re: [Zope] Check to see if someone is a user, or anonymous
Jonothan Farr wrote:
<dtml-if "REQUEST.has_key('AUTHENTICATED_USER')">
or rather
<dtml-if "AUTHENTICATED_USER.getUserName()!='Anonymous'">
as in:
<dtml-if "AUTHENTICATED_USER.getUserName()!='Anonymous'"> whatever <dtml-else> whatever else </dtml-if>
Rik
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Baker, Dennis (sjmr) -
Jonothan Farr -
Rik Hoekstra