X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=blobdiff_plain;f=ipsilon%2Flogin%2Fauthpam.py;h=10b550eaeefe4cf264c5ed92ec598857299a488d;hp=58e07cf74ffe904b09defda59ab5a131ed867920;hb=62b4656571be6e8671ada295047eac385d330f66;hpb=25b8eaf83e681a9322cffe61aad5254bcbe0c917 diff --git a/ipsilon/login/authpam.py b/ipsilon/login/authpam.py index 58e07cf..10b550e 100755 --- a/ipsilon/login/authpam.py +++ b/ipsilon/login/authpam.py @@ -20,7 +20,6 @@ from ipsilon.login.common import LoginFormBase, LoginManagerBase from ipsilon.login.common import FACILITY from ipsilon.util.plugin import PluginObject -import cherrypy import pam import subprocess @@ -34,10 +33,10 @@ class Pam(LoginFormBase): ok = pam.authenticate(username, password) if ok: - cherrypy.log("User %s successfully authenticated." % username) + self.log("User %s successfully authenticated." % username) return username - cherrypy.log("User %s failed authentication." % username) + self.log("User %s failed authentication." % username) return None def POST(self, *args, **kwargs): @@ -49,13 +48,13 @@ class Pam(LoginFormBase): if username and password: user = self._authenticate(username, password) if user: - return self.lm.auth_successful(user, 'password') + return self.lm.auth_successful(self.trans, user, 'password') else: error = "Authentication failed" - cherrypy.log.error(error) + self.error(error) else: error = "Username or password is missing" - cherrypy.log.error("Error: " + error) + self.error("Error: " + error) context = self.create_tmpl_context( username=username, @@ -99,6 +98,8 @@ for authentication. """ 'Password' ], } + self.conf_opt_order = ['service name', 'username text', + 'password text', 'help text'] @property def service_name(self): @@ -144,8 +145,7 @@ class Installer(object): po.wipe_config_values(FACILITY) config = {'service name': opts['pam_service']} - po.set_config(config) - po.save_plugin_config(FACILITY) + po.save_plugin_config(FACILITY, config) # Update global config to add login plugin po = PluginObject() @@ -157,8 +157,7 @@ class Installer(object): order = [] order.append('pam') globalconf['order'] = ','.join(order) - po.set_config(globalconf) - po.save_plugin_config(FACILITY) + po.save_plugin_config(FACILITY, globalconf) # for selinux enabled platforms, ignore if it fails just report try: