Exemple #1
0
 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()
Exemple #2
0
 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