modifié: login.py
modifié: superTornado.py
This commit is contained in:
parent
ebc902a322
commit
e3fb1bb3fa
1
login.py
1
login.py
@ -6,7 +6,6 @@ from datetime import datetime
|
|||||||
class Login(object):
|
class Login(object):
|
||||||
def verifLogin(self,pLog,pMdp):
|
def verifLogin(self,pLog,pMdp):
|
||||||
hashMdp = hashlib.sha224(pMdp).hexdigest()
|
hashMdp = hashlib.sha224(pMdp).hexdigest()
|
||||||
print "Hash pass " + hashMdp
|
|
||||||
with open("fichier/autorise", "r") as source :
|
with open("fichier/autorise", "r") as source :
|
||||||
for ligne in source :
|
for ligne in source :
|
||||||
data = ligne.rstrip('\n\r').split(',')
|
data = ligne.rstrip('\n\r').split(',')
|
||||||
|
@ -29,7 +29,7 @@ class MainHandler(BaseHandler):
|
|||||||
|
|
||||||
login = Login()
|
login = Login()
|
||||||
autorise = login.connexion(iden, mdp)
|
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:
|
if autorise == True:
|
||||||
ficLog.enregDansLog(iden,"Authorized user connection","IP TO DO")
|
ficLog.enregDansLog(iden,"Authorized user connection","IP TO DO")
|
||||||
if confAveug == True:
|
if confAveug == True:
|
||||||
@ -52,7 +52,6 @@ class VideoHandler(BaseHandler):
|
|||||||
return
|
return
|
||||||
self.render("video.html")
|
self.render("video.html")
|
||||||
|
|
||||||
|
|
||||||
class UnauthorizedHandler(BaseHandler):
|
class UnauthorizedHandler(BaseHandler):
|
||||||
def get(self):
|
def get(self):
|
||||||
self.render("illegal.html")
|
self.render("illegal.html")
|
||||||
@ -71,15 +70,13 @@ class UnauthorizedHandler(BaseHandler):
|
|||||||
else :
|
else :
|
||||||
self.redirect("/")
|
self.redirect("/")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AJAXHandler(BaseHandler):
|
class AJAXHandler(BaseHandler):
|
||||||
def post(self):
|
def post(self):
|
||||||
if not self.current_user :
|
if not self.current_user :
|
||||||
self.redirect("/")
|
self.redirect("/")
|
||||||
return
|
return
|
||||||
try :
|
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()
|
data = f.read()
|
||||||
encoded = base64.b64encode(data)
|
encoded = base64.b64encode(data)
|
||||||
self.write(encoded)
|
self.write(encoded)
|
||||||
|
Reference in New Issue
Block a user