C# Класс Rock.Model.UserLoginService

Data Access/Service class for Rock.Model.UserLogin entities.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Create ( RockContext rockContext, Rock person, AuthenticationServiceType serviceType, int entityTypeId, string username, string password, bool isConfirmed ) : UserLogin

Creates a new Rock.Model.UserLogin

Create ( RockContext rockContext, Rock person, AuthenticationServiceType serviceType, int entityTypeId, string username, string password, bool isConfirmed, bool isRequirePasswordChange ) : UserLogin

Creates the specified rock context.

FriendlyPasswordRules ( ) : string

Returns a user friendly description of the password rules.

GetByApiKey ( string apiKey ) : IQueryable

Returns an enumerable collection of Rock.Model.UserLogin entities by their API Key.

GetByConfirmationCode ( string code ) : UserLogin

Returns a Rock.Model.UserLogin by an encrypted confirmation code.

GetByPersonId ( int personId ) : IQueryable

Gets an enumerable collection of Rock.Model.UserLogin entities by a Person's PersonId.

GetByUserName ( string userName ) : UserLogin

GetsRock.Model.UserLogin by User Name

GetCurrentUser ( ) : UserLogin

Returns the Rock.Model.UserLogin of the user who is currently logged in.

GetCurrentUser ( bool userIsOnline ) : UserLogin

Returns the Rock.Model.UserLogin

IsPasswordValid ( string password ) : bool

Checks to see if the given password is valid according to the PasswordRegex (if defined).

SetPassword ( UserLogin user, string password ) : void

Sets the a UserLogin's password.

UpdateLastLogin ( string userName ) : void

Updates the last login.

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

Метод Описание
UpdateFailureCount ( UserLogin user ) : void

Updates the Rock.Model.UserLogin failed password attempt count.

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

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

Creates a new Rock.Model.UserLogin
Thrown when the Username already exists. Thrown when the service does not exist or is not active.
public static Create ( RockContext rockContext, Rock person, AuthenticationServiceType serviceType, int entityTypeId, string username, string password, bool isConfirmed ) : UserLogin
rockContext RockContext The rock context.
person Rock The that this will be associated with.
serviceType AuthenticationServiceType The type of Login
entityTypeId int The entity type identifier.
username string A containing the UserName.
password string A containing the unhashed/unencrypted password.
isConfirmed bool A flag indicating if the user has been confirmed.
Результат UserLogin

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

Creates the specified rock context.
username;Username already exists /// entityTypeId /// or /// Invalid EntityTypeId, entity does not exist;entityTypeId /// or /// Invalid Person, person does not exist;person ///
public static Create ( RockContext rockContext, Rock person, AuthenticationServiceType serviceType, int entityTypeId, string username, string password, bool isConfirmed, bool isRequirePasswordChange ) : UserLogin
rockContext RockContext The rock context.
person Rock The person.
serviceType AuthenticationServiceType Type of the service.
entityTypeId int The entity type identifier.
username string The username.
password string The password.
isConfirmed bool if set to true [is confirmed].
isRequirePasswordChange bool if set to true [is require password change].
Результат UserLogin

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

Returns a user friendly description of the password rules.
public static FriendlyPasswordRules ( ) : string
Результат string

GetByApiKey() публичный метод

Returns an enumerable collection of Rock.Model.UserLogin entities by their API Key.
public GetByApiKey ( string apiKey ) : IQueryable
apiKey string A representing the API key to search by.
Результат IQueryable

GetByConfirmationCode() публичный метод

Returns a Rock.Model.UserLogin by an encrypted confirmation code.
public GetByConfirmationCode ( string code ) : UserLogin
code string A containing the encrypted confirmation code to search for.
Результат UserLogin

GetByPersonId() публичный метод

Gets an enumerable collection of Rock.Model.UserLogin entities by a Person's PersonId.
public GetByPersonId ( int personId ) : IQueryable
personId int A representing the Id of the to search by. This property is nullable /// to find entities that are not associated with a Person.
Результат IQueryable

GetByUserName() публичный метод

GetsRock.Model.UserLogin by User Name
public GetByUserName ( string userName ) : UserLogin
userName string A representing the UserName to search for.
Результат UserLogin

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

Returns the Rock.Model.UserLogin of the user who is currently logged in.
public static GetCurrentUser ( ) : UserLogin
Результат UserLogin

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

Returns the Rock.Model.UserLogin
public static GetCurrentUser ( bool userIsOnline ) : UserLogin
userIsOnline bool A value that returns the logged in user if true; otherwise can return the impersonated user
Результат UserLogin

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

Checks to see if the given password is valid according to the PasswordRegex (if defined).
public static IsPasswordValid ( string password ) : bool
password string A password to verify.
Результат bool

SetPassword() публичный метод

Sets the a UserLogin's password.
public SetPassword ( UserLogin user, string password ) : void
user UserLogin The to change the password for.
password string A representing the new password.
Результат void

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

Updates the last login.
public static UpdateLastLogin ( string userName ) : void
userName string Name of the user.
Результат void