C# 클래스 Worki.Memberships.WorkiMembershipProvider

상속: System.Web.Security.MembershipProvider
파일 보기 프로젝트 열기: tah91/eworkyWebSite

Private Properties

프로퍼티 타입 설명
CheckPassword bool
EncodePassword string
GeneratePassword string
GenerateSalt string
GetConfigValue string
GetUserFromMember System.Web.Security.MembershipUser
HexToByte byte[]
ResetAuthenticationFailures void
UnEncodePassword string

공개 메소드들

메소드 설명
ChangePassword ( string username, string oldPassword, string newPassword ) : bool

Change the current password for a new one. Note: Both are required.

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

Change the password retreival/reset question and answer pair

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

Creates a new user with a given set of default values

DeleteUser ( string username, bool deleteAllRelatedData ) : bool

Permanently deletes a user from the database

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

Finds a list of users with a matching email address

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

Gets a list of users with a matching username

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

Gets all the users in the database

GetNumberOfUsersOnline ( ) : int

Gets the total number of users that are currently online.

GetPassword ( string username, string answer ) : string

Gets the current password of a user (provided it isn't hashed)

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

Gets a MembershipUser object with a given key

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

Gets a MembershipUser object with a given username

GetUserNameByEmail ( string email ) : string

Gets the username by a given matching email address

Initialize ( string name, System config ) : void
ResetPassword ( string username, string answer ) : string

Resets the passwords with a generated value

UnlockUser ( string userName ) : bool

Unlocks a user (after too many login attempts perhaps)

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

Updates an existing user with new settings

ValidateUser ( string username, string password ) : bool

Authenticates a user with the given username and password

비공개 메소드들

메소드 설명
CheckPassword ( string password, string dbpassword, string dbsalt ) : bool

Compares a given password with one stored in the database and an optional salt

EncodePassword ( string password ) : string

Encodes a given password using the default MembershipPasswordFormat setting

GeneratePassword ( int passLength ) : string

Generates a random password of given length (MinRequiredPasswordLength)

GenerateSalt ( ) : string

Salt generation helper (this is essentially the same as the one in SqlMembershipProviders

GetConfigValue ( string configValue, string defaultValue ) : string

Used in the initializtion, key in web.config or the default setting if null.

GetUserFromMember ( Member m ) : System.Web.Security.MembershipUser

Converts a Member object into a MembershipUser object using its assigned settings

HexToByte ( string hexString ) : byte[]

Converts a string into a byte array

ResetAuthenticationFailures ( Member &m, System.DateTime dt ) : void

Upon a successful login or password reset, this changes all the previous failure markers to defaults.

UnEncodePassword ( string encodedPassword ) : string

Decodes a given stored password into a cleartype or unencrypted form. Provided it isn't hashed.

메소드 상세

ChangePassword() 공개 메소드

Change the current password for a new one. Note: Both are required.
public ChangePassword ( string username, string oldPassword, string newPassword ) : bool
username string Username the password is being changed for
oldPassword string Old password to verify owner
newPassword string New password
리턴 bool

ChangePasswordQuestionAndAnswer() 공개 메소드

Change the password retreival/reset question and answer pair
public ChangePasswordQuestionAndAnswer ( string username, string password, string newPasswordQuestion, string newPasswordAnswer ) : bool
username string Username the question and answer are being changed for
password string Current password
newPasswordQuestion string New password question
newPasswordAnswer string New password answer (will also be encrypted)
리턴 bool

CreateUser() 공개 메소드

Creates a new user with a given set of default values
public CreateUser ( string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, MembershipCreateStatus &status ) : System.Web.Security.MembershipUser
username string
password string
email string
passwordQuestion string
passwordAnswer string
isApproved bool
providerUserKey object
status MembershipCreateStatus
리턴 System.Web.Security.MembershipUser

DeleteUser() 공개 메소드

Permanently deletes a user from the database
public DeleteUser ( string username, bool deleteAllRelatedData ) : bool
username string Username to delete
deleteAllRelatedData bool Should or shouldn't delete related user data
리턴 bool

FindUsersByEmail() 공개 메소드

Finds a list of users with a matching email address
public FindUsersByEmail ( string emailToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
emailToMatch string Given email to search
pageIndex int Current page index
pageSize int Number of results per page
totalRecords int Total number of users returned
리턴 System.Web.Security.MembershipUserCollection

FindUsersByName() 공개 메소드

Gets a list of users with a matching username
public FindUsersByName ( string usernameToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
usernameToMatch string Username to search for
pageIndex int Current page index
pageSize int Number of results per page
totalRecords int Total number of users returned
리턴 System.Web.Security.MembershipUserCollection

GetAllUsers() 공개 메소드

Gets all the users in the database
public GetAllUsers ( int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
pageIndex int Current page index
pageSize int Number of results per page
totalRecords int Total number of users returned
리턴 System.Web.Security.MembershipUserCollection

GetNumberOfUsersOnline() 공개 메소드

Gets the total number of users that are currently online.
public GetNumberOfUsersOnline ( ) : int
리턴 int

GetPassword() 공개 메소드

Gets the current password of a user (provided it isn't hashed)
public GetPassword ( string username, string answer ) : string
username string User the password is being retrieved for
answer string Password retrieval answer
리턴 string

GetUser() 공개 메소드

Gets a MembershipUser object with a given key
public GetUser ( object providerUserKey, bool userIsOnline ) : System.Web.Security.MembershipUser
providerUserKey object
userIsOnline bool
리턴 System.Web.Security.MembershipUser

GetUser() 공개 메소드

Gets a MembershipUser object with a given username
public GetUser ( string username, bool userIsOnline ) : System.Web.Security.MembershipUser
username string
userIsOnline bool
리턴 System.Web.Security.MembershipUser

GetUserNameByEmail() 공개 메소드

Gets the username by a given matching email address
public GetUserNameByEmail ( string email ) : string
email string
리턴 string

Initialize() 공개 메소드

public Initialize ( string name, System config ) : void
name string
config System
리턴 void

ResetPassword() 공개 메소드

Resets the passwords with a generated value
public ResetPassword ( string username, string answer ) : string
username string User the password is being reset for
answer string Password retrieval answer
리턴 string

UnlockUser() 공개 메소드

Unlocks a user (after too many login attempts perhaps)
public UnlockUser ( string userName ) : bool
userName string Username to unlock
리턴 bool

UpdateUser() 공개 메소드

Updates an existing user with new settings
public UpdateUser ( System.Web.Security.MembershipUser user ) : void
user System.Web.Security.MembershipUser MembershipUser object to modify
리턴 void

ValidateUser() 공개 메소드

Authenticates a user with the given username and password
public ValidateUser ( string username, string password ) : bool
username string Login password
password string The login username
리턴 bool