Exemple #1
0
 def POST(self):
     f = self.login_form()
     if not f.validates():
         return render.login(f, 'Please fill in both fields.')
     else:
         user = users.authenticate(f.d.username, f.d.password)
         if user:
             users.login(user)
             i = web.input()
             raise web.seeother(i.next)
         else:
             return render.login(f, 'Does not authenticate.')
Exemple #2
0
 def GET(self):
     f = self.login_form()
     return render.login(f, None)