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
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):
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,
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()
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: