PHP Class Devise\Users\Sessions\SessionsRepository

Datei anzeigen Open project: devisephp/cms Class Usage Examples

Public Properties

Property Type Description
$errors array Errors are kept in an array and can be used later if validation fails and we want to know why
$message string This is a message that we can store why validation failed

Protected Properties

Property Type Description
$DvsUser DvsUser DvsUser model to fetch database records
$Framework Devise\Support\Framework Framework components being used from Laravel's framework
$UserManager Devise\Users\UserManager UserManager manages users
$UsersRepository Devise\Users\UsersRepository UsersRepository fetches users and related data

Public Methods

Method Description
__construct ( DvsUser $DvsUser, UserManager $UserManager, UsersRepository $UsersRepository, Framework $Framework ) Create a new SessionsRepository instance.
activate ( integer $userId, string $activateCode ) : False | DeviseUser Process user activation request.
getRememberMe ( $input ) : boolean Get "remember_me" field value
login ( array $input ) : User Attempty to login a user
logout ( ) : boolean Log user out
recoverPassword ( array $input ) : Response Handle a POST request to recover password
resetPassword ( array $input ) : Response Handle POST data from reset (change) password form
sendActivationEmail ( DvsUser $user ) : Void Send activation email.
validateCredentials ( $credentials ) : boolean Validate user credentials (without logging user into system)

Protected Methods

Method Description
attemptUserLogin ( array $input ) : DvsUser | false Iterates through an array of username/email fields in the users table and attempts to authenticate an instance of DvsUser
retrieveUserFindMethodByField ( string $fieldname, string $value ) : DvsUser Gets the proper UsersRepository find method for a user based on the fieldname being passed in.

Private Methods

Method Description
checkFieldExists ( $field )

Method Details

__construct() public method

Create a new SessionsRepository instance.
public __construct ( DvsUser $DvsUser, UserManager $UserManager, UsersRepository $UsersRepository, Framework $Framework )
$DvsUser DvsUser
$UserManager Devise\Users\UserManager
$UsersRepository Devise\Users\UsersRepository
$Framework Devise\Support\Framework

activate() public method

Process user activation request.
public activate ( integer $userId, string $activateCode ) : False | DeviseUser
$userId integer
$activateCode string
return False | DeviseUser | DeviseUser

attemptUserLogin() protected method

Iterates through an array of username/email fields in the users table and attempts to authenticate an instance of DvsUser
protected attemptUserLogin ( array $input ) : DvsUser | false
$input array
return DvsUser | false | false

getRememberMe() public method

Get "remember_me" field value
public getRememberMe ( $input ) : boolean
return boolean

login() public method

Attempty to login a user
public login ( array $input ) : User
$input array
return User

logout() public method

Log user out
public logout ( ) : boolean
return boolean

recoverPassword() public method

Handle a POST request to recover password
public recoverPassword ( array $input ) : Response
$input array
return Response

resetPassword() public method

Handle POST data from reset (change) password form
public resetPassword ( array $input ) : Response
$input array
return Response

retrieveUserFindMethodByField() protected method

Gets the proper UsersRepository find method for a user based on the fieldname being passed in.
protected retrieveUserFindMethodByField ( string $fieldname, string $value ) : DvsUser
$fieldname string
$value string
return DvsUser

sendActivationEmail() public method

Send activation email.
public sendActivationEmail ( DvsUser $user ) : Void
$user DvsUser
return Void

validateCredentials() public method

Validate user credentials (without logging user into system)
public validateCredentials ( $credentials ) : boolean
return boolean

Property Details

$DvsUser protected_oe property

DvsUser model to fetch database records
protected DvsUser $DvsUser
return DvsUser

$Framework protected_oe property

Framework components being used from Laravel's framework
protected Framework,Devise\Support $Framework
return Devise\Support\Framework

$UserManager protected_oe property

UserManager manages users
protected UserManager,Devise\Users $UserManager
return Devise\Users\UserManager

$UsersRepository protected_oe property

UsersRepository fetches users and related data
protected UsersRepository,Devise\Users $UsersRepository
return Devise\Users\UsersRepository

$errors public_oe property

Errors are kept in an array and can be used later if validation fails and we want to know why
public array $errors
return array

$message public_oe property

This is a message that we can store why validation failed
public string $message
return string