Exemplo n.º 1
0
 def POST(self):
     f = signupform()
     
     if f.validates():
         if(people.personexists(f.d.email)):
             print config.base.layout(view.signup(f, exists=True))
         else:
             password = auth.h(f.d.password)
             people.createperson(f.d.name, f.d.email, password)
             web.seeother('/login/')
     else:
         print config.base.layout(view.signup(f))
Exemplo n.º 2
0
 def POST(self):
     f = loginform()
     
     if f.validates():
         password = auth.h(f.d.password)
         person = people.authenticate(f.d.email, password)
         
         if person:
             auth.setcookie(person)
             web.seeother('/dashboard/')
         else:
             print config.base.layout(view.login(f, error=True))
     else:
         print config.base.layout(view.login(f))