view MoinMoin/auth/log.py @ 4109:e88baf535b48

fix backup action configuration (broke on windows due to backslashes in e.g. cache_dir), try 2. cfg.backup_exclude is now just a function of filename, telling whether the file should be excluded. By default, no file is excluded.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 19 Sep 2008 21:41:40 +0200
parents 40c4670c3410
children 70dfb3dea12d
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - logging auth plugin

    This does nothing except logging the auth parameters (the password is NOT
    logged, of course).

    @copyright: 2006-2008 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

from MoinMoin import log
logging = log.getLogger(__name__)

from MoinMoin.auth import BaseAuth, ContinueLogin

class AuthLog(BaseAuth):
    """ just log the call, do nothing else """
    name = "log"

    def log(self, request, action, user_obj, kw):
        logging.info('%s: user_obj=%r kw=%r' % (action, user_obj, kw))

    def login(self, request, user_obj, **kw):
        self.log(request, 'login', user_obj, kw)
        return ContinueLogin(user_obj)

    def request(self, request, user_obj, **kw):
        self.log(request, 'session', user_obj, kw)
        return user_obj, True

    def logout(self, request, user_obj, **kw):
        self.log(request, 'logout', user_obj, kw)
        return user_obj, True