X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=blobdiff_plain;f=ipsilon%2Flogin%2Fauthfas.py;h=8af7f28b78a3c45ff5624b5b338d87f34ad82b67;hp=a44b470451f59cb1997da6fb6d59a7d24ac8a0db;hb=cfe24fa3dc15d87f3ace944a2d62a0f4c5ee496c;hpb=29542bc6407f06edb5bebedc64b84802f1ccb154 diff --git a/ipsilon/login/authfas.py b/ipsilon/login/authfas.py index a44b470..8af7f28 100644 --- a/ipsilon/login/authfas.py +++ b/ipsilon/login/authfas.py @@ -1,11 +1,12 @@ -# Copyright (C) 2014 Ipsilon contributors, see COPYING file for license +# Copyright (C) 2014 Ipsilon project Contributors, for license see COPYING - -from ipsilon.login.common import LoginFormBase, LoginManagerBase +from ipsilon.login.common import LoginFormBase, LoginManagerBase, \ + LoginManagerInstaller from ipsilon.util.plugin import PluginObject from ipsilon.util.policy import Policy from ipsilon.util import config as pconfig import cherrypy +import logging from fedora.client.fasproxy import FasProxyClient from fedora.client import AuthError @@ -53,9 +54,12 @@ class FAS(LoginFormBase): try: _, data = self.lm.fpc.login(username, password) except AuthError, e: - cherrypy.log.error("Authentication error [%s]" % str(e)) + cherrypy.log.error("Authentication error [%s]" % str(e), + severity=logging.ERROR) except Exception, e: # pylint: disable=broad-except - cherrypy.log.error("Unknown Error [%s]" % str(e)) + cherrypy.log.error("Unknown Error [%s]" % str(e), + severity=logging.ERROR) + if data and data.user: userdata = self.make_userdata(data.user) return self.lm.auth_successful(self.trans, @@ -63,10 +67,10 @@ class FAS(LoginFormBase): userdata=userdata) else: error = "Authentication failed" - cherrypy.log.error(error) + cherrypy.log.error(error, severity=logging.ERROR) else: error = "Username or password is missing" - cherrypy.log.error("Error: " + error) + cherrypy.log.error("Error: " + error, severity=logging.ERROR) context = self.create_tmpl_context( username=username, @@ -74,7 +78,7 @@ class FAS(LoginFormBase): error_password=not password, error_username=not username ) - # pylint: disable=star-args + self.lm.set_auth_error() return self._template(self.formtemplate, **context) def make_userdata(self, fas_data): @@ -170,11 +174,11 @@ Form based login Manager that uses the Fedora Authentication Server return self.page -class Installer(object): +class Installer(LoginManagerInstaller): def __init__(self, *pargs): + super(Installer, self).__init__() self.name = 'fas' - self.ptype = 'login' self.pargs = pargs def install_args(self, group):