C# Class Phun.Security.PhunWebSecurity

Not trying to be microsoft websecurity which is horrible. Static?
Afficher le fichier Open project: noogen/phuncms

Méthodes publiques

Свойство Type Description
EnableSimpleMembershipKey string

Private Properties

Свойство Type Description
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

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

ChangePassword() public static méthode

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.
Résultat bool

ConfirmAccount() public static méthode

Confirms the account.
public static ConfirmAccount ( string accountConfirmationToken ) : bool
accountConfirmationToken string The account confirmation token.
Résultat bool

ConfirmAccount() public static méthode

Confirms the account.
public static ConfirmAccount ( string userName, string accountConfirmationToken ) : bool
userName string Name of the user.
accountConfirmationToken string The account confirmation token.
Résultat bool

GetCreateDate() public static méthode

Gets the create date.
public static GetCreateDate ( string userName ) : System.DateTime
userName string Name of the user.
Résultat System.DateTime

GetLastPasswordFailureDate() public static méthode

Gets the last password failure date.
public static GetLastPasswordFailureDate ( string userName ) : System.DateTime
userName string Name of the user.
Résultat System.DateTime

GetPasswordChangedDate() public static méthode

Gets the password changed date.
public static GetPasswordChangedDate ( string userName ) : System.DateTime
userName string Name of the user.
Résultat System.DateTime

GetPasswordFailuresSinceLastSuccess() public static méthode

Gets the password failures since last success.
public static GetPasswordFailuresSinceLastSuccess ( string userName ) : int
userName string Name of the user.
Résultat int

GetUserId() public static méthode

Gets the user id.
public static GetUserId ( string userName ) : int
userName string Name of the user.
Résultat int

GetUserIdFromPasswordResetToken() public static méthode

Gets the user id from password reset token.
public static GetUserIdFromPasswordResetToken ( string token ) : int
token string The token.
Résultat int

InitializeDatabaseConnection() public static méthode

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].
Résultat void

IsAccountLockedOut() public static méthode

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.
Résultat bool

IsAccountLockedOut() public static méthode

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.
Résultat bool

IsConfirmed() public static méthode

Determines whether the specified user name is confirmed.
public static IsConfirmed ( string userName ) : bool
userName string Name of the user.
Résultat bool

IsCurrentUser() public static méthode

Determines whether [is current user] [the specified user name].
public static IsCurrentUser ( string userName ) : bool
userName string Name of the user.
Résultat bool

RequireAuthenticatedUser() public static méthode

Requires the authenticated user.
public static RequireAuthenticatedUser ( ) : void
Résultat void

RequireRoles() public static méthode

Requires the roles.
public static RequireRoles ( ) : void
Résultat void

RequireUser() public static méthode

Requires the user.
public static RequireUser ( int userId ) : void
userId int The user id.
Résultat void

RequireUser() public static méthode

Requires the user.
public static RequireUser ( string userName ) : void
userName string Name of the user.
Résultat void

ResetPassword() public static méthode

Resets the password.
public static ResetPassword ( string passwordResetToken, string newPassword ) : bool
passwordResetToken string The password reset token.
newPassword string The new password.
Résultat bool

UserExists() public static méthode

Users the exists.
public static UserExists ( string userName ) : bool
userName string Name of the user.
Résultat bool

Property Details

EnableSimpleMembershipKey public_oe static_oe property

The enable simple membership key
public static string EnableSimpleMembershipKey
Résultat string