-
Notifications
You must be signed in to change notification settings - Fork 0
Classes
HappyFakeBoulder edited this page Jun 20, 2018
·
1 revision
Sets up some variables
Sets self.encryptVars.result to an encrypted form of the passWord
If db is given, this method will use what is passed in db as the database, otherwise it will use self.dbVars.savedDatabase
This method simulates logging in, setting self.loginVars.user and self.loginVars.status
self.loginVars.status will be set to one of the self-explanatory string values upon executing the function:
"SuccessfulLogin"
"IncorrectPassword"
"UserDoesNotExist"
Reads from the file with the name provided by dbName, assuming it is a text file, and turns the information in the file into a dictionary, in which each odd-numbered line is a key and each even-numbered line is a value, storing the dictionary in self.dbVars.savedDatabase
Saves the data in self.dbVars.savedDatabase into the file with the name provided by filename, assuming it is a text file, storing the information in a similar format as what is described in LoadDataBase.
Adds an entry into self.dbVars.savedDatabase with the key of userName and the value of an encrypted form of passWord. It returns a self-explanatory string in self.registerVars.status from the following list:
"InvalidCharInUsername"
"InvalidCharInPassword"
"UsernameTaken"
"SuccessfulRegister"
ChangePassword(str userName, str oldPassWord, str newPassWord (encrypted), str/list PWprohibited, int key)
Changes the value for self.dbVars.savedDatabase[userName], and returns a self-explanatory string into self.chngpswdVars.status from the following list:
"InvalidCharInPassword"
"UserDoesNotExist"
"SuccessfulPswdChng"
"IncorrectOldPassword"
If self.loginVars.user is not None (someone is logged in), it will set it to None (log out).
Sets up some variables, using the provided values.
Runs an interface for logging in and registering.
Gives the user an option to log out.
Runs an interface for changing password and logging out.
A blank class. Used in the __init__ functions of the other classes.