Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib as hash
- def login(user, hash_pass):
- m = hash.md5()
- m.update(b"%s" % hash_pass)
- tempPass = m.hexdigest()
- f = open("approved.tapFile",'r').readlines().strip("\n")
- for x in f:
- if x == user+":"+tempPass:
- return True
- break
- def registrer(user,hash_pass):
- m = hash.md5()
- m.update(b"%s" % hash_pass)
- tempPass = m.hexdigest()
- f = open("request.tapFile",'a')
- f.write(user+":"+tempPass+"\n")
- f.flush()
- def approve(user):
- f = open("approved.tapFile",'r').readlines().strip("\n")
- f1 = open("request.tapFile",'r').readLines().strip("\n")
- for x in f1:
- for y in f:
- if x[0:x.find(":")] == user and not y[0:y.find(":")] == user:
- f = open("approved.tapFile",'a')
- f.write(x + "\n")
- f.flush()
- return True
- else:
- return False
Add Comment
Please, Sign In to add comment