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):
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,
'Password'
],
}
+ self.conf_opt_order = ['service name', 'username text',
+ 'password text', 'help text']
@property
def service_name(self):
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: