Example #1
0
 def POST(this):
   if not user.isLoggedIn():
     raise web.seeother('/login')
   else:
     errors = []
     form = create_account_form()
     return render.main(**locals())
Example #2
0
  def POST(this):
    if user.isLoggedIn(): return web.seeother('/')
    data = web.input(password='', username='')
    errors = []

    logging.log('Checking login form')
    if not csua_ldap.checkUser(data.username):
      errors.append('User not found')
    elif not csua_ldap.checkLogin(data):
      errors.append('Password did not match')
    elif not this.token == data.authenticity:
      errors.append('Session expired')

    if len(errors) > 0:
      logging.warning('Login form error occurred, re-render')
      return render.login(**locals())
    else:
      logging.log('Login correct')
      user.logIn(data.username, data.password)
      return web.seeother('/')
Example #3
0
 def GET(this):
   if user.isLoggedIn():
     user.logOut()
   return web.seeother('/')
Example #4
0
 def GET(this):
   if user.isLoggedIn(): return web.seeother('/')
   errors = []
   data = web.input(password='', username='')
   return render.login(**locals())
Example #5
0
 def __init__(this):
   this.loggedIn = user.isLoggedIn()
   this.token = csrf_token()
   this.title = "Login Form - CSUA Acount Form"
Example #6
0
 def GET(this):
   if not user.isLoggedIn():
     raise web.seeother('/login')
   else:
     errors = []
     return render.main(**locals())