C# Class CinderellaMGS.UserAccounts

Exibir arquivo Open project: ThomasMoreCollege/CinderellaMGS

Public Methods

Method Description
ProtectPassword ( string password ) : string

This method will take a password and return the salted hash version to be stored in the database.

UserAccounts ( ) : System
add_delete_Roles ( string username, string role, bool add ) : void

Adds or removes roles from a user.

deleteUser ( string username ) : void

Deletes a user account as well as all roles associated with it.

editAccount ( string username, string password, string lname, string fname, bool insert ) : bool

Allows an account record to be updated.

getRoles ( ) : DataSet

Retrieves all available roles in the database.

getUserAccountRecord ( string username ) : DataSet

Retrieves all data associated with a specific user account.

getUserAssignedRoles ( string username ) : DataSet

Retrieves all roles assigned to a username.

getUsers ( ) : DataSet

Retrieves all user accounts currently in the system.

loginTimestamp ( string username ) : void

Updates the last login timestamp for a specific username.

setUser ( string username, string lname, string fname, string password ) : void

Adds a user account record to the database.

userHasRole ( string username, string role ) : bool

Checks to see if a user has a role.

Method Details

ProtectPassword() public method

This method will take a password and return the salted hash version to be stored in the database.
public ProtectPassword ( string password ) : string
password string
return string

UserAccounts() public method

public UserAccounts ( ) : System
return System

add_delete_Roles() public method

Adds or removes roles from a user.
public add_delete_Roles ( string username, string role, bool add ) : void
username string
role string Role to add or delete
add bool True-Add Role :: False-Remove Role
return void

deleteUser() public method

Deletes a user account as well as all roles associated with it.
public deleteUser ( string username ) : void
username string
return void

editAccount() public method

Allows an account record to be updated.
public editAccount ( string username, string password, string lname, string fname, bool insert ) : bool
username string
password string
lname string
fname string
insert bool
return bool

getRoles() public method

Retrieves all available roles in the database.
public getRoles ( ) : DataSet
return System.Data.DataSet

getUserAccountRecord() public method

Retrieves all data associated with a specific user account.
public getUserAccountRecord ( string username ) : DataSet
username string
return System.Data.DataSet

getUserAssignedRoles() public method

Retrieves all roles assigned to a username.
public getUserAssignedRoles ( string username ) : DataSet
username string
return System.Data.DataSet

getUsers() public method

Retrieves all user accounts currently in the system.
public getUsers ( ) : DataSet
return System.Data.DataSet

loginTimestamp() public method

Updates the last login timestamp for a specific username.
public loginTimestamp ( string username ) : void
username string
return void

setUser() public method

Adds a user account record to the database.
public setUser ( string username, string lname, string fname, string password ) : void
username string
lname string
fname string
password string
return void

userHasRole() public method

Checks to see if a user has a role.
public userHasRole ( string username, string role ) : bool
username string
role string Role to check
return bool