This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
2014-02-27 18:58:09 +00:00
|
|
|
import hashlib
|
|
|
|
import httplib
|
2014-03-02 21:57:48 +00:00
|
|
|
|
2014-02-27 18:58:09 +00:00
|
|
|
|
|
|
|
class Login(object):
|
|
|
|
def verifLogin(self,pLog,pMdp):
|
|
|
|
hashMdp = hashlib.sha224(pMdp).hexdigest()
|
2014-03-01 21:06:28 +00:00
|
|
|
with open("m/fichier/autorise", "r") as source :
|
2014-02-27 18:58:09 +00:00
|
|
|
for ligne in source :
|
|
|
|
data = ligne.rstrip('\n\r').split(',')
|
2014-03-03 12:55:30 +00:00
|
|
|
if data[0] == pLog :
|
2014-02-27 18:58:09 +00:00
|
|
|
if data[1] in hashMdp :
|
|
|
|
source.close()
|
|
|
|
return True
|
|
|
|
source.close()
|
|
|
|
return False
|
|
|
|
|
|
|
|
def connexion(self,pLog,pMdp):
|
|
|
|
if self.verifLogin(pLog,pMdp) == True :
|
|
|
|
return True
|
|
|
|
else :
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|