C# Класс Phun.Security.PhunWebSecurity

Not trying to be microsoft websecurity which is horrible. Static?
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
EnableSimpleMembershipKey string

Private Properties

Свойство Тип Описание
CreateAccount string
CreateDefaultSimpleMembershipProvider PhunSimpleMembershipProvider
CreateDefaultSimpleRoleProvider WebMatrix.WebData.SimpleRoleProvider
CreateUserAndAccount string
GeneratePasswordResetToken string
InitializeMembershipProvider void
InitializeProviders void
InitializeRoleProvider void
IsAccountLockedOutInternal bool
IsUserLoggedOn bool
Login bool
Logout void
PreAppStartInit void
VerifyProvider WebMatrix.WebData.ExtendedMembershipProvider

Открытые методы

Метод Описание
ChangePassword ( string userName, string currentPassword, string newPassword ) : bool

Changes the password.

ConfirmAccount ( string accountConfirmationToken ) : bool

Confirms the account.

ConfirmAccount ( string userName, string accountConfirmationToken ) : bool

Confirms the account.

GetCreateDate ( string userName ) : System.DateTime

Gets the create date.

GetLastPasswordFailureDate ( string userName ) : System.DateTime

Gets the last password failure date.

GetPasswordChangedDate ( string userName ) : System.DateTime

Gets the password changed date.

GetPasswordFailuresSinceLastSuccess ( string userName ) : int

Gets the password failures since last success.

GetUserId ( string userName ) : int

Gets the user id.

GetUserIdFromPasswordResetToken ( string token ) : int

Gets the user id from password reset token.

InitializeDatabaseConnection ( string connectionStringName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables ) : void

Initializes the database connection.

IsAccountLockedOut ( string userName, int allowedPasswordAttempts, System.TimeSpan interval ) : bool

Determines whether [is account locked out] [the specified user name].

IsAccountLockedOut ( string userName, int allowedPasswordAttempts, int intervalInSeconds ) : bool

Determines whether [is account locked out] [the specified user name].

IsConfirmed ( string userName ) : bool

Determines whether the specified user name is confirmed.

IsCurrentUser ( string userName ) : bool

Determines whether [is current user] [the specified user name].

RequireAuthenticatedUser ( ) : void

Requires the authenticated user.

RequireRoles ( ) : void

Requires the roles.

RequireUser ( int userId ) : void

Requires the user.

RequireUser ( string userName ) : void

Requires the user.

ResetPassword ( string passwordResetToken, string newPassword ) : bool

Resets the password.

UserExists ( string userName ) : bool

Users the exists.

Приватные методы

Метод Описание
CreateAccount ( string userName, string password, bool requireConfirmationToken = false ) : string
CreateDefaultSimpleMembershipProvider ( string name, MembershipProvider currentDefault ) : PhunSimpleMembershipProvider

Creates the default simple membership provider.

CreateDefaultSimpleRoleProvider ( string name, System.Web.Security.RoleProvider currentDefault ) : WebMatrix.WebData.SimpleRoleProvider

Creates the default simple role provider.

CreateUserAndAccount ( string userName, string password, object propertyValues = null, bool requireConfirmationToken = false ) : string
GeneratePasswordResetToken ( string userName, int tokenExpirationInMinutesFromNow = 1440 ) : string
InitializeMembershipProvider ( PhunSimpleMembershipProvider simpleMembership, string connectionStringName, string userTableName, string userIdColumn, string userNameColumn, bool createTables ) : void

Initializes the membership provider.

InitializeProviders ( string connectionStringName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables ) : void

Initializes the providers.

InitializeRoleProvider ( PhunSimpleRoleProvider simpleRoles, string connectionStringName, string userTableName, string userIdColumn, string userNameColumn, bool createTables ) : void

Initializes the role provider.

IsAccountLockedOutInternal ( WebMatrix.WebData.ExtendedMembershipProvider provider, string userName, int allowedPasswordAttempts, System.TimeSpan interval ) : bool

Determines whether [is account locked out internal] [the specified provider].

IsUserLoggedOn ( int userId ) : bool
Login ( string userName, string password, bool persistCookie = false ) : bool
Logout ( ) : void
PreAppStartInit ( ) : void

Pres the app start init.

VerifyProvider ( ) : WebMatrix.WebData.ExtendedMembershipProvider

Verifies the provider.

Описание методов

ChangePassword() публичный статический Метод

Changes the password.
public static ChangePassword ( string userName, string currentPassword, string newPassword ) : bool
userName string Name of the user.
currentPassword string The current password.
newPassword string The new password.
Результат bool

ConfirmAccount() публичный статический Метод

Confirms the account.
public static ConfirmAccount ( string accountConfirmationToken ) : bool
accountConfirmationToken string The account confirmation token.
Результат bool

ConfirmAccount() публичный статический Метод

Confirms the account.
public static ConfirmAccount ( string userName, string accountConfirmationToken ) : bool
userName string Name of the user.
accountConfirmationToken string The account confirmation token.
Результат bool

GetCreateDate() публичный статический Метод

Gets the create date.
public static GetCreateDate ( string userName ) : System.DateTime
userName string Name of the user.
Результат System.DateTime

GetLastPasswordFailureDate() публичный статический Метод

Gets the last password failure date.
public static GetLastPasswordFailureDate ( string userName ) : System.DateTime
userName string Name of the user.
Результат System.DateTime

GetPasswordChangedDate() публичный статический Метод

Gets the password changed date.
public static GetPasswordChangedDate ( string userName ) : System.DateTime
userName string Name of the user.
Результат System.DateTime

GetPasswordFailuresSinceLastSuccess() публичный статический Метод

Gets the password failures since last success.
public static GetPasswordFailuresSinceLastSuccess ( string userName ) : int
userName string Name of the user.
Результат int

GetUserId() публичный статический Метод

Gets the user id.
public static GetUserId ( string userName ) : int
userName string Name of the user.
Результат int

GetUserIdFromPasswordResetToken() публичный статический Метод

Gets the user id from password reset token.
public static GetUserIdFromPasswordResetToken ( string token ) : int
token string The token.
Результат int

InitializeDatabaseConnection() публичный статический Метод

Initializes the database connection.
public static InitializeDatabaseConnection ( string connectionStringName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables ) : void
connectionStringName string Name of the connection string.
userTableName string Name of the user table.
userIdColumn string The user id column.
userNameColumn string The user name column.
autoCreateTables bool if set to true [auto create tables].
Результат void

IsAccountLockedOut() публичный статический Метод

Determines whether [is account locked out] [the specified user name].
public static IsAccountLockedOut ( string userName, int allowedPasswordAttempts, System.TimeSpan interval ) : bool
userName string Name of the user.
allowedPasswordAttempts int The allowed password attempts.
interval System.TimeSpan The interval.
Результат bool

IsAccountLockedOut() публичный статический Метод

Determines whether [is account locked out] [the specified user name].
public static IsAccountLockedOut ( string userName, int allowedPasswordAttempts, int intervalInSeconds ) : bool
userName string Name of the user.
allowedPasswordAttempts int The allowed password attempts.
intervalInSeconds int The interval in seconds.
Результат bool

IsConfirmed() публичный статический Метод

Determines whether the specified user name is confirmed.
public static IsConfirmed ( string userName ) : bool
userName string Name of the user.
Результат bool

IsCurrentUser() публичный статический Метод

Determines whether [is current user] [the specified user name].
public static IsCurrentUser ( string userName ) : bool
userName string Name of the user.
Результат bool

RequireAuthenticatedUser() публичный статический Метод

Requires the authenticated user.
public static RequireAuthenticatedUser ( ) : void
Результат void

RequireRoles() публичный статический Метод

Requires the roles.
public static RequireRoles ( ) : void
Результат void

RequireUser() публичный статический Метод

Requires the user.
public static RequireUser ( int userId ) : void
userId int The user id.
Результат void

RequireUser() публичный статический Метод

Requires the user.
public static RequireUser ( string userName ) : void
userName string Name of the user.
Результат void

ResetPassword() публичный статический Метод

Resets the password.
public static ResetPassword ( string passwordResetToken, string newPassword ) : bool
passwordResetToken string The password reset token.
newPassword string The new password.
Результат bool

UserExists() публичный статический Метод

Users the exists.
public static UserExists ( string userName ) : bool
userName string Name of the user.
Результат bool

Описание свойств

EnableSimpleMembershipKey публичное статическое свойство

The enable simple membership key
public static string EnableSimpleMembershipKey
Результат string