예제 #1
0
파일: newuser.py 프로젝트: tombin/bbs
 def getUserInfo(self):
     username = raw_input(self.config['loginPrompt'])
     if checkUserExists(username):
         print self.config['userUnavailable'] 
     else:
         print self.config['userAvailable']
         self.username = username
         self.updatePwFile()
예제 #2
0
파일: login.py 프로젝트: tombin/bbs
 def checkPasswd(self, username):
     passwdFile = {}
     enteredPw = getpass(self.config["passwdPrompt"])
     with open("passwd", "r") as fd:
         for line in fd:
             line = line.strip("\n")
             (user, passwd) = line.split(":")
             passwdFile[user] = passwd
     if checkUserExists(username) and sha256_crypt.verify(enteredPw, passwdFile[username]):
         return True
     else:
         return False