Thanks for help, but it didn't fix my problem, my complete source code http://dpaste.com/756057/
2012/6/6 Leandro Severino <[email protected]> > Hi Mauro, > > I'm from pt_br too. > > Try this: > > ps: Sorry by my dirt code !. > > [ my code.py ] > > webapp = web.application(urls, globals()) > session = web.session.Session(webapp, > web.session.DiskStore('sessions'), initializer={'captcha': 0, > 'isAdmin':0, 'admin_user': ''}) > > def session_hook(): > web.ctx.session = session > > webapp.add_processor(web.loadhook(session_hook)) > > > [ my admin.py ] > > class Login(object): > def GET(self): > return render.layout(render.login(**d)) > > def POST(self): > i = web.input() > try: > if i.username and i.password: > logado = model.login(i.username, i.password) > if logado.login: > if logado.nivel_acesso == 1: > web.ctx.session.isAdmin = 1 > else: > web.ctx.session.isAdmin = logado.nivel_acesso > web.ctx.session.admin_user = logado.login > web.ctx.session.logged=logado > raise web.seeother('/') > else: > d['error'] = "Usuário ou Senha inválidos!" > except: > d['error'] = "Usuário ou Senha inválidos!" > return render.layout(render.login(**d)) > > -- > You received this message because you are subscribed to the Google Groups > "web.py" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/webpy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
