Exemplo n.º 1
0
 def POST(self):
     # TODO: mover login para o model
     user = web.input().user
     password = web.input().password
     if session.login(user, password):
         raise web.seeother('/')
     else:
         return view.login()
Exemplo n.º 2
0
 def GET(self):
     if is_logged():
         web.header('Cache-Control', 'no-cache, no-store, must-revalidate')
         web.header('Pragma', 'no-cache')
         web.header('Expires', '-1')
         return view.index()
     else:
         web.header('Cache-Control', 'no-cache, no-store, must-revalidate')
         web.header('Pragma', 'no-cache')
         web.header('Expires', '-1')
         return view.login()