JDUserManager Class Reference

Creates a manager used to safely request and create user data. More...

List of all members.

Public Member Functions

(instancetype) - init
(bool) - loginUser:withPassword:
(int) - getUserID:
(enum JDUSER_TYPE) - getUserType:
(bool) - userExists:
(bool) - newUser:withPassword:withFirstName:andLastName:andEmail:andType:
(NSString *) - hashPassword:withSalt:
(bool) - createUsersTable

Properties

JDDatabaseManagerdbManager

Detailed Description

Creates a manager used to safely request and create user data.


Member Function Documentation

- (int) getUserID: (NSString *)  userName  

This function will get the user id based on their username

Parameters:
userName 
Returns:
integer value of the user id, -1 on failure
- (enum JDUSER_TYPE) getUserType: (NSString *)  userID  

Discover the type of user for the given id.

Parameters:
userID the user id to look up for, as a string convertible to integer
Returns:
The users type as defined by the JDUSER_TYPE enumeration in the JDUserManager.h file
- (NSString *) hashPassword: (NSString *)  plainText
withSalt: (NSString *)  salt 

This function will hash the users password so it is not stored in plain text

Parameters:
plainText the plain text password to hash up
salt the salt value for the hash
Returns:
the hashed string to store/check or null on bad hash
- (instancetype) init  

Initializes Tractor Manager and makes sure databases exists.

- (bool) loginUser: (NSString *)  userName
withPassword: (NSString *)  passWord 

This function will attempt to login the user to the application

Parameters:
userName the username to attempt to log in
passWord the password string to check (unhashed)
Returns:
BOOL true if login successful, false otherwise
- (bool) newUser: (NSString *)  userName
withPassword: (NSString *)  passwWord
withFirstName: (NSString *)  firstName
andLastName: (NSString *)  lastName
andEmail: (NSString *)  email
andType: (enum JDUSER_TYPE)  userType 

This function will create the new user in the database where appropriate

Parameters:
userName name of the user to create
passWord password to hash and store
firstName first name of the new user
lastName last name of the new user
email email of the new user
userType type of user that this user will be
Returns:
true on success false one failure
- (bool) userExists: (NSString *)  userName  

Checks if this user already exists in the data base or not

Parameters:
userName name of the user to check for
Returns:
YES if exists NO if not exists

The documentation for this class was generated from the following files:
 All Classes Functions Properties

Generated on 27 Apr 2015 for My Project by  doxygen 1.6.1