示例#1
0
	def __init_session(self,user):
		self.session['auth'] = {
			'jid' : user.jid,
			'password' : user.password,
			'acl' : user.acl
		}
		log = LogsLogin(userRef=user)
		log.put()
示例#2
0
	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.'