Back to index

moin  1.9.0~rc2
logout.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - logout action
00004 
00005     The real logout is done in MoinMoin.request.
00006     Here is just some stuff to notify the user.
00007 
00008     @copyright: 2005-2006 Radomirs Cirskis <nad2000@gmail.com>
00009     @license: GNU GPL, see COPYING for details.
00010 """
00011 
00012 from MoinMoin.Page import Page
00013 
00014 def execute(pagename, request):
00015     return LogoutHandler(pagename, request).handle()
00016 
00017 class LogoutHandler:
00018     def __init__(self, pagename, request):
00019         self.request = request
00020         self._ = request.getText
00021         self.page = Page(request, pagename)
00022 
00023     def handle(self):
00024         _ = self._
00025         # if the user really was logged out say so,
00026         # but if the user manually added ?action=logout
00027         # and that isn't really supported, then don't
00028         if not self.request.user.valid:
00029             self.request.theme.add_msg(_("You are now logged out."), "info")
00030         return self.page.send_page()
00031