예제 #1
0
 def POST(self):
     i = web.input(username=None, password=None)
     if i.username and i.password:
         admin = web.ctx.orm.query(Admin).filter_by(username=i.username).first()
         if admin:
             if hashlib.md5(i.password).hexdigest() == admin.password:
                 web.ctx.session.isAdmin = 1
                 raise web.seeother('/')
     d['error'] = "Wrong username/password!"
     return render.login(**d)
예제 #2
0
 def POST(self):
     i = web.input(username=None, password=None)
     if i.username and i.password:
         admin = web.ctx.orm.query(Admin).filter_by(
             username=i.username).first()
         if admin:
             if hashlib.md5(i.password).hexdigest() == admin.password:
                 web.ctx.session.isAdmin = 1
                 raise web.seeother('/')
     d['error'] = "Wrong username/password!"
     return render.login(**d)
예제 #3
0
 def GET(self):
     return render.login(**d)
예제 #4
0
 def GET(self):
     return render.login(**d)