C# Class Rock.Model.UserLoginService

Data Access/Service class for Rock.Model.UserLogin entities.
Mostrar archivo Open project: NewSpring/Rock Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
UpdateFailureCount ( UserLogin user ) : void

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

Method Details

Create() public static method

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.
return UserLogin

Create() public static method

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].
return UserLogin

FriendlyPasswordRules() public static method

Returns a user friendly description of the password rules.
public static FriendlyPasswordRules ( ) : string
return string

GetByApiKey() public method

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.
return IQueryable

GetByConfirmationCode() public method

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.
return UserLogin

GetByPersonId() public method

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.
return IQueryable

GetByUserName() public method

GetsRock.Model.UserLogin by User Name
public GetByUserName ( string userName ) : UserLogin
userName string A representing the UserName to search for.
return UserLogin

GetCurrentUser() public static method

Returns the Rock.Model.UserLogin of the user who is currently logged in.
public static GetCurrentUser ( ) : UserLogin
return UserLogin

GetCurrentUser() public static method

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
return UserLogin

IsPasswordValid() public static method

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.
return bool

SetPassword() public method

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.
return void

UpdateLastLogin() public static method

Updates the last login.
public static UpdateLastLogin ( string userName ) : void
userName string Name of the user.
return void