def __init_session(self,user): self.session['auth'] = { 'jid' : user.jid, 'password' : user.password, 'acl' : user.acl } log = LogsLogin(userRef=user) log.put()
def _post(self): if(self.request.get('login') and self.request.get('pass')): user = Roster.findByJid(self.request.get('login')) #user.password = md5.new(self.request.get('pass')).hexdigest() #user.acl = Acl.ADMIN #user.put() if user != None and user.password == md5.new(self.request.get('pass')).hexdigest(): self.session['auth'] = { 'jid' : user.jid, 'password' : user.password, 'acl' : user.acl } log = LogsLogin(userRef=user) log.put() super(Controller, self).redirect('/') else: self.view['info'] = 'Błędny login lub hasło.'