[Zope] logging out (not zmi)

Dieter Maurer dieter at handshake.de
Wed Sep 28 13:02:49 EDT 2005


paul.hendrick at gmail.com wrote at 2005-9-27 18:11 +0100:
>If i'm logged in as testuser and want to log in with a different user
>name, whats the right way of doing it?
>this is on zope 2.7

When you are using HTTP authentication, then logging out is difficult
(and nasty).

The following DTML method helps you to log out:

<dtml-var standard_html_header>
<h2><dtml-var title_or_id> <dtml-var document_title></h2>
<p>
<dtml-if "AUTHENTICATED_USER.getUserName() != 'Anonymous User'">
  <dtml-raise Unauthorized></dtml-raise>
</dtml-if>
You have been logged out.
</p>
<dtml-var standard_html_footer>


When you call it via an URL, you will get a login dialog.
Put in any name and a *WRONG* password.
When you finish the dialog, you should see "You have been logged out".
After that, you can login again in the normal way.

Note, that in case you use correct login information
(a right password), then the login dialog will come again...


-- 
Dieter


More information about the Zope mailing list