C# Class BlogEngine.Core.Providers.XmlMembershipProvider

Inheritance: System.Web.Security.MembershipProvider
Show file Open project: rasmuskl/ReSharperCourse

Private Properties

Property Type Description
CheckPassword bool
ReadMembershipDataStore void

Public Methods

Method Description
ChangePassword ( string username, string oldPassword, string newPassword ) : bool

Processes a request to update the password for a membership user.

ChangePasswordQuestionAndAnswer ( string username, string password, string newPasswordQuestion, string newPasswordAnswer ) : bool

Processes a request to update the password question and answer for a membership user.

CreateUser ( string username, string password, string email, string passwordQuestion, string passwordAnswer, bool approved, object providerUserKey, MembershipCreateStatus &status ) : System.Web.Security.MembershipUser

Creates the user.

DeleteUser ( string username, bool deleteAllRelatedData ) : bool

Removes a user from the membership data source.

FindUsersByEmail ( string emailToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection

Gets a collection of membership users where the e-mail address contains the specified e-mail address to match.

FindUsersByName ( string usernameToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection

Gets a collection of membership users where the user name contains the specified user name to match.

GetAllUsers ( int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection

Retrieves a collection of all the users. This implementation ignores pageIndex and pageSize, and it doesn't sort the MembershipUser objects returned.

GetNumberOfUsersOnline ( ) : int

The get number of users online.

GetPassword ( string username ) : string

Gets the password for the user with the given username.

GetPassword ( string username, string answer ) : string

Gets the password for the specified user name from the data source.

GetUser ( object providerUserKey, bool userIsOnline ) : System.Web.Security.MembershipUser

Get a user based on the username parameter. the userIsOnline parameter is ignored.

GetUser ( string username, bool userIsOnline ) : System.Web.Security.MembershipUser

Retrieves a user based on his/hers username. the userIsOnline parameter is ignored.

GetUserNameByEmail ( string email ) : string

Retrieves a username based on a matching email.

Initialize ( string name, NameValueCollection config ) : void

Initializes the provider.

ResetPassword ( string username, string answer ) : string

Resets a user's password to a new, automatically generated password.

UnlockUser ( string userName ) : bool

Clears a lock so that the membership user can be validated.

UpdateUser ( System.Web.Security.MembershipUser user ) : void

Updates a user. The username will not be changed.

ValidateUser ( string username, string password ) : bool

Returns true if the username and password match an exsisting user.

Private Methods

Method Description
CheckPassword ( string storedPassword, string inputPassword ) : bool

The check password.

ReadMembershipDataStore ( ) : void

Builds the internal cache of users.

Method Details

ChangePassword() public method

Processes a request to update the password for a membership user.
public ChangePassword ( string username, string oldPassword, string newPassword ) : bool
username string The user to update the password for.
oldPassword string The current password for the specified user.
newPassword string The new password for the specified user.
return bool

ChangePasswordQuestionAndAnswer() public method

Processes a request to update the password question and answer for a membership user.
public ChangePasswordQuestionAndAnswer ( string username, string password, string newPasswordQuestion, string newPasswordAnswer ) : bool
username string The user to change the password question and answer for.
password string The password for the specified user.
newPasswordQuestion string The new password question for the specified user.
newPasswordAnswer string The new password answer for the specified user.
return bool

CreateUser() public method

Creates the user.
public CreateUser ( string username, string password, string email, string passwordQuestion, string passwordAnswer, bool approved, object providerUserKey, MembershipCreateStatus &status ) : System.Web.Security.MembershipUser
username string The username.
password string The password.
email string The email.
passwordQuestion string The password question.
passwordAnswer string The password answer.
approved bool if set to true [approved].
providerUserKey object The provider user key.
status MembershipCreateStatus The status.
return System.Web.Security.MembershipUser

DeleteUser() public method

Removes a user from the membership data source.
public DeleteUser ( string username, bool deleteAllRelatedData ) : bool
username string The name of the user to delete.
deleteAllRelatedData bool true to delete data related to the user from the database; false to leave data related to the user in the database.
return bool

FindUsersByEmail() public method

Gets a collection of membership users where the e-mail address contains the specified e-mail address to match.
public FindUsersByEmail ( string emailToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
emailToMatch string The e-mail address to search for.
pageIndex int The index of the page of results to return. is zero-based.
pageSize int The size of the page of results to return.
totalRecords int The total number of matched users.
return System.Web.Security.MembershipUserCollection

FindUsersByName() public method

Gets a collection of membership users where the user name contains the specified user name to match.
public FindUsersByName ( string usernameToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
usernameToMatch string The user name to search for.
pageIndex int The index of the page of results to return. is zero-based.
pageSize int The size of the page of results to return.
totalRecords int The total number of matched users.
return System.Web.Security.MembershipUserCollection

GetAllUsers() public method

Retrieves a collection of all the users. This implementation ignores pageIndex and pageSize, and it doesn't sort the MembershipUser objects returned.
public GetAllUsers ( int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
pageIndex int The page Index.
pageSize int The page Size.
totalRecords int The total Records.
return System.Web.Security.MembershipUserCollection

GetNumberOfUsersOnline() public method

The get number of users online.
public GetNumberOfUsersOnline ( ) : int
return int

GetPassword() public method

Gets the password for the user with the given username.
public GetPassword ( string username ) : string
username string /// the given username ///
return string

GetPassword() public method

Gets the password for the specified user name from the data source.
public GetPassword ( string username, string answer ) : string
username string /// The user to retrieve the password for. ///
answer string /// The password answer for the user. ///
return string

GetUser() public method

Get a user based on the username parameter. the userIsOnline parameter is ignored.
public GetUser ( object providerUserKey, bool userIsOnline ) : System.Web.Security.MembershipUser
providerUserKey object /// The provider User Key. ///
userIsOnline bool /// The user Is Online. ///
return System.Web.Security.MembershipUser

GetUser() public method

Retrieves a user based on his/hers username. the userIsOnline parameter is ignored.
public GetUser ( string username, bool userIsOnline ) : System.Web.Security.MembershipUser
username string /// The username. ///
userIsOnline bool /// The user Is Online. ///
return System.Web.Security.MembershipUser

GetUserNameByEmail() public method

Retrieves a username based on a matching email.
public GetUserNameByEmail ( string email ) : string
email string /// The email. ///
return string

Initialize() public method

Initializes the provider.
/// The name of the provider is null. /// /// The name of the provider has a length of zero. /// /// An attempt is made to call on a provider after the provider has already been initialized. ///
public Initialize ( string name, NameValueCollection config ) : void
name string The friendly name of the provider.
config System.Collections.Specialized.NameValueCollection A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.
return void

ResetPassword() public method

Resets a user's password to a new, automatically generated password.
public ResetPassword ( string username, string answer ) : string
username string The user to reset the password for.
answer string The password answer for the specified user.
return string

UnlockUser() public method

Clears a lock so that the membership user can be validated.
public UnlockUser ( string userName ) : bool
userName string The membership user whose lock status you want to clear.
return bool

UpdateUser() public method

Updates a user. The username will not be changed.
public UpdateUser ( System.Web.Security.MembershipUser user ) : void
user System.Web.Security.MembershipUser /// The membership user. ///
return void

ValidateUser() public method

Returns true if the username and password match an exsisting user.
public ValidateUser ( string username, string password ) : bool
username string /// The username. ///
password string /// The password. ///
return bool