renommé: fichier/autorise -> m/fichier/autorise
renommé: fichier/conf -> m/fichier/conf renommé: fichier/log -> m/fichier/log renommé: loadConf.py -> m/loadConf.py renommé: login.py -> m/login.py modifié: superTornado.py renommé: illegal.html -> v/illegal.html renommé: images/iut.jpg -> v/images/iut.jpg renommé: index.html -> v/index.html renommé: js/jquery-2.1.0.min.js -> v/js/jquery-2.1.0.min.js renommé: style/styles.css -> v/style/styles.css renommé: video.html -> v/video.html
This commit is contained in:
3
m/fichier/autorise
Normal file
3
m/fichier/autorise
Normal file
@ -0,0 +1,3 @@
|
||||
jmi,4a01e734262d501b39f58c1ee57b67f4bc18da3046ab716396e0170a
|
||||
pso,4a01e734262d501b39f58c1ee57b67f4bc18da3046ab716396e0170a
|
||||
ln,4a01e734262d501b39f58c1ee57b67f4bc18da3046ab716396e0170a
|
1
m/fichier/conf
Normal file
1
m/fichier/conf
Normal file
@ -0,0 +1 @@
|
||||
handicap=1
|
1
m/fichier/log
Normal file
1
m/fichier/log
Normal file
@ -0,0 +1 @@
|
||||
|
16
m/loadConf.py
Normal file
16
m/loadConf.py
Normal file
@ -0,0 +1,16 @@
|
||||
class LoadConf(object):
|
||||
def loadHand(self):
|
||||
with open("fichier/conf", "r") as source :
|
||||
for ligne in source:
|
||||
data = ligne.rstrip('\n\r').split('=')
|
||||
if data[0] in 'handicap' :
|
||||
source.close()
|
||||
return data[1]
|
||||
source.close()
|
||||
return 0
|
||||
|
||||
def estAveugle(self):
|
||||
if self.loadHand() == "1" :
|
||||
return True
|
||||
else :
|
||||
return False
|
37
m/login.py
Normal file
37
m/login.py
Normal file
@ -0,0 +1,37 @@
|
||||
import time
|
||||
import hashlib
|
||||
import httplib
|
||||
from datetime import datetime
|
||||
|
||||
class Login(object):
|
||||
def verifLogin(self,pLog,pMdp):
|
||||
hashMdp = hashlib.sha224(pMdp).hexdigest()
|
||||
with open("fichier/autorise", "r") as source :
|
||||
for ligne in source :
|
||||
data = ligne.rstrip('\n\r').split(',')
|
||||
if data[0] in pLog :
|
||||
if data[1] in hashMdp :
|
||||
source.close()
|
||||
return True
|
||||
source.close()
|
||||
return False
|
||||
|
||||
def enregDansLog(self,pLog,pMsg,pIP):
|
||||
with open("fichier/log", "a") as dest :
|
||||
d = datetime.now().strftime("%c")
|
||||
dest.write("%s,%s,%s,%s\n" % (d,pLog,pMsg,pIP))
|
||||
|
||||
def connexion(self,pLog,pMdp):
|
||||
if self.verifLogin(pLog,pMdp) == True :
|
||||
return True
|
||||
else :
|
||||
return False
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user