Back to index

moin  1.9.0~rc2
log.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - logging auth plugin
00004 
00005     This does nothing except logging the auth parameters (the password is NOT
00006     logged, of course).
00007 
00008     @copyright: 2006-2008 MoinMoin:ThomasWaldmann
00009     @license: GNU GPL, see COPYING for details.
00010 """
00011 
00012 from MoinMoin import log
00013 logging = log.getLogger(__name__)
00014 
00015 from MoinMoin.auth import BaseAuth, ContinueLogin
00016 
00017 class AuthLog(BaseAuth):
00018     """ just log the call, do nothing else """
00019     name = "log"
00020 
00021     def log(self, request, action, user_obj, kw):
00022         logging.info('%s: user_obj=%r kw=%r' % (action, user_obj, kw))
00023 
00024     def login(self, request, user_obj, **kw):
00025         self.log(request, 'login', user_obj, kw)
00026         return ContinueLogin(user_obj)
00027 
00028     def request(self, request, user_obj, **kw):
00029         self.log(request, 'session', user_obj, kw)
00030         return user_obj, True
00031 
00032     def logout(self, request, user_obj, **kw):
00033         self.log(request, 'logout', user_obj, kw)
00034         return user_obj, True