-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
ConnorC18 edited this page Mar 24, 2019
·
5 revisions
from loginSystem import * # Loads the login librarysignup() # Will return True or the error message thrown by the functionlogin() # Will return True or "incorrectinfo" or "noaccount" depending on the error.checkLoggedIn() # Will return True of FalsepasswordReset() # Will return True or "noemail" or "wrongsecurityquestionanswer"print(sessionInfo["username"]) # Will return the current logged in users, usernamelogout() # Will return True or "notloggedin"out = signUp()
if (out != True):
print("Sign Up Error! Please try again.")
error = out out = login()
switcher = {
"incorrectinfo": "Error: Incorrect Login Details.",
"noaccount": "Error: No Account in that name."
}
print(switcher.get(out, "Unknown Error!"))if (checkLoggedIn()):
print("Loading Account Page")
else:
print("Error user is not logged in")out = passwordReset()
switcher = {
"wrongsecurityquestionanswer": "Error: Incorrect Security Question Answer.",
"noemail": "Error: No Account in that email."
}
print(switcher.get(out, "Unknown Error!"))print("Username = ",sessionInfo["username"])out = logout()
if (out != True):
print("User has logged out")
else:
print("Error: No logged in user")