Exemple #1
0
#First check if user account exists
fileFound = FileHandler.DoesAccountExist()
if (not fileFound):
    #Create user account since it doesn't exist
    try:
        CreateAccount()
        console.out(17)  #Success, account created
    except Exception:
        console.out(18)  #Failure
        raise

#Now get the user to log in to their account
credentialPass = False

validationKey = Encryptor.GenerateSALT()
while (not credentialPass):
    verification = VerifyUser()
    if (not verification[0]):
        if (verification[1] == "Invalid"):
            #console.cls()
            console.out(24, 0.03)
    else:
        #Success, user has logged in
        securityKey = Encryptor.GenerateSecurityKey()
        FileHandler.CreateSecurityFile(
            Encryptor.OneWayEncryptor(securityKey, validationKey), username)
        Command = CMD.CommandHandler(username, verification[1])
        credentialPass = verification

PasswordLocker()