from ipsilon.util.plugin import PluginObject
from ipsilon.util import config as pconfig
import cherrypy
+import logging
class TestAuth(LoginFormBase):
if username and password:
if password == 'ipsilon':
cherrypy.log("User %s successfully authenticated." % username)
- testdata = {'fullname': 'Test User %s' % username}
+ testdata = {
+ 'givenname': 'Test User',
+ 'surname': username,
+ 'fullname': 'Test User %s' % username,
+ 'email': '%s@example.com' % username,
+ '_groups': [username]
+ }
return self.lm.auth_successful(self.trans,
username, 'password', testdata)
else:
error = "Authentication failed"
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,
if opts['testauth'] != 'yes':
return
- print self.pargs
+ logging.debug(self.pargs)
# Add configuration data to database
po = PluginObject(*self.pargs)
po.name = 'testauth'