modifié: login.py

modifié:         superTornado.py
This commit is contained in:
sidya82 2014-02-28 05:27:07 +01:00
parent ebc902a322
commit e3fb1bb3fa
2 changed files with 2 additions and 6 deletions

View File

@ -6,7 +6,6 @@ from datetime import datetime
class Login(object):
def verifLogin(self,pLog,pMdp):
hashMdp = hashlib.sha224(pMdp).hexdigest()
print "Hash pass " + hashMdp
with open("fichier/autorise", "r") as source :
for ligne in source :
data = ligne.rstrip('\n\r').split(',')

View File

@ -29,7 +29,7 @@ class MainHandler(BaseHandler):
login = Login()
autorise = login.connexion(iden, mdp)
#maison = httplib.HTTPConnection("192.168.16.150", 80)
print 'maison = httplib.HTTPConnection("192.168.16.150", 80)'
if autorise == True:
ficLog.enregDansLog(iden,"Authorized user connection","IP TO DO")
if confAveug == True:
@ -52,7 +52,6 @@ class VideoHandler(BaseHandler):
return
self.render("video.html")
class UnauthorizedHandler(BaseHandler):
def get(self):
self.render("illegal.html")
@ -71,15 +70,13 @@ class UnauthorizedHandler(BaseHandler):
else :
self.redirect("/")
class AJAXHandler(BaseHandler):
def post(self):
if not self.current_user :
self.redirect("/")
return
try :
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195', 'image/temp.jpg')
f = urlopen('http://test:a@192.168.1.15/image.jpg?cidx=791836195')
data = f.read()
encoded = base64.b64encode(data)
self.write(encoded)