[Zope] Zope Logout

Keith Alperin KAlperin@ignitesports.com
Wed, 30 Jan 2002 14:33:07 -0600


Greetings Zopistas!

I'm currently working on a site where I have one requirement left to
fulfill before I can release.  I need to be able to allow users to
logout and sign in as someone else.  After doing some research I came up
with some DTML that looks like this (I don't have the code in front of
me, but it's pretty similar):

<dtml-raise Unauthorized>
	You are not authorized
</dtml-raise>

This does log the person out, but also generates a pretty ugly error
message.  If possible, I'd like to use a redirect.  However, this still
raised the Unauthorized error:

<dtml-raise Unauthorized>
	<dtml-var expr=3D"RESPONSE.redirect('/')">
</dtml-raise>

Finally, I tried a try/finally block which still errored out:

<dtml-try>
<dtml-raise Unauthorized>
	You are not authorized
</dtml-raise>
<dtml-finally>
	<dtml-var expr=3D"RESPONSE.redirect('/')">
</dtml-try>

Any advice that anyone can provide would be MOST appreciated.

Thanks so much!

Keith R. Alperin