PHP Class Sentinel\Repositories\User\SentryUserRepository

Inheritance: implements Sentinel\Repositories\User\SentinelUserRepositoryInterface, implements Illuminate\Contracts\Auth\UserProvider
Show file Open project: rydurham/sentinel

Protected Properties

Property Type Description
$config
$dispatcher
$sentry

Public Methods

Method Description
__construct ( Cartalyst\Sentry\Sentry $sentry, Illuminate\Config\Repository $config, Illuminate\Events\Dispatcher $dispatcher ) Construct a new SentryUser Object
activate ( integer $id, string $code ) : boolean Attempt activation for the specified user
all ( ) : Collection Return all the registered users
ban ( integer $id ) : Array Ban a user
changeGroupMemberships ( $userId, $selections ) : Sentinel\DataTransferObjects\BaseResponse Process a change password request.
changePassword ( $data ) : Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse Process a password change request
changePasswordWithoutCheck ( $data ) : Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse Change a user's password without checking their old password first
destroy ( integer $id ) : Sentinel\DataTransferObjects\BaseResponse Remove the specified resource from storage.
getUser ( ) : user Return the current active user
resend ( Array $data ) : Sentinel\DataTransferObjects\BaseResponse Resend the activation email to the specified email address
resetPassword ( integer $id, string $code, $password ) : Array Process the password reset request
retrieveByCredentials ( array $credentials ) : Illuminate\Auth\UserInterface | null Retrieve a user by the given credentials.
retrieveById ( mixed $identifier ) : Illuminate\Auth\UserInterface | null Retrieve a user by their unique identifier.
retrieveByToken ( mixed $identifier, string $token ) : Illuminate\Auth\UserInterface | null Retrieve a user by by their unique identifier and "remember me" token.
store ( $data ) : Sentinel\DataTransferObjects\BaseResponse Store a newly created user in storage.
suspend ( integer $id ) : Array Suspend a user
triggerPasswordReset ( $email ) : Bool The user has requested a password reset
unBan ( integer $id ) : Array Remove a users' ban
unSuspend ( $id ) : array Remove a users' suspension.
update ( array $data ) : Sentinel\DataTransferObjects\BaseResponse Update the specified resource in storage.
updateRememberToken ( Illuminate\Contracts\Auth\Authenticatable $user, string $token ) : void Update the "remember me" token for the given user in storage.
validateCredentials ( Illuminate\Contracts\Auth\Authenticatable $user, array $credentials ) : boolean Validate a user against the given credentials.
validateResetCode ( $id, $code ) : Sentinel\DataTransferObjects\FailureResponse Validate a password reset link

Method Details

__construct() public method

Construct a new SentryUser Object
public __construct ( Cartalyst\Sentry\Sentry $sentry, Illuminate\Config\Repository $config, Illuminate\Events\Dispatcher $dispatcher )
$sentry Cartalyst\Sentry\Sentry
$config Illuminate\Config\Repository
$dispatcher Illuminate\Events\Dispatcher

activate() public method

Attempt activation for the specified user
public activate ( integer $id, string $code ) : boolean
$id integer
$code string
return boolean

all() public method

Return all the registered users
public all ( ) : Collection
return Collection

ban() public method

Ban a user
public ban ( integer $id ) : Array
$id integer
return Array

changeGroupMemberships() public method

Process a change password request.
public changeGroupMemberships ( $userId, $selections ) : Sentinel\DataTransferObjects\BaseResponse
return Sentinel\DataTransferObjects\BaseResponse

changePassword() public method

Process a password change request
public changePassword ( $data ) : Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse
$data
return Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse

changePasswordWithoutCheck() public method

Change a user's password without checking their old password first
public changePasswordWithoutCheck ( $data ) : Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse
$data
return Sentinel\DataTransferObjects\FailureResponse | Sentinel\DataTransferObjects\SuccessResponse

destroy() public method

Remove the specified resource from storage.
public destroy ( integer $id ) : Sentinel\DataTransferObjects\BaseResponse
$id integer
return Sentinel\DataTransferObjects\BaseResponse

getUser() public method

Return the current active user
public getUser ( ) : user
return user object

resend() public method

Resend the activation email to the specified email address
public resend ( Array $data ) : Sentinel\DataTransferObjects\BaseResponse
$data Array
return Sentinel\DataTransferObjects\BaseResponse

resetPassword() public method

Process the password reset request
public resetPassword ( integer $id, string $code, $password ) : Array
$id integer
$code string
return Array

retrieveByCredentials() public method

Retrieve a user by the given credentials.
public retrieveByCredentials ( array $credentials ) : Illuminate\Auth\UserInterface | null
$credentials array
return Illuminate\Auth\UserInterface | null

retrieveById() public method

Retrieve a user by their unique identifier.
public retrieveById ( mixed $identifier ) : Illuminate\Auth\UserInterface | null
$identifier mixed
return Illuminate\Auth\UserInterface | null

retrieveByToken() public method

Retrieve a user by by their unique identifier and "remember me" token.
public retrieveByToken ( mixed $identifier, string $token ) : Illuminate\Auth\UserInterface | null
$identifier mixed
$token string
return Illuminate\Auth\UserInterface | null

store() public method

Store a newly created user in storage.
public store ( $data ) : Sentinel\DataTransferObjects\BaseResponse
return Sentinel\DataTransferObjects\BaseResponse

suspend() public method

Suspend a user
public suspend ( integer $id ) : Array
$id integer
return Array

triggerPasswordReset() public method

The user has requested a password reset
public triggerPasswordReset ( $email ) : Bool
return Bool

unBan() public method

Remove a users' ban
public unBan ( integer $id ) : Array
$id integer
return Array

unSuspend() public method

Remove a users' suspension.
public unSuspend ( $id ) : array
$id
return array [type] [description]

update() public method

Update the specified resource in storage.
public update ( array $data ) : Sentinel\DataTransferObjects\BaseResponse
$data array
return Sentinel\DataTransferObjects\BaseResponse

updateRememberToken() public method

Update the "remember me" token for the given user in storage.
public updateRememberToken ( Illuminate\Contracts\Auth\Authenticatable $user, string $token ) : void
$user Illuminate\Contracts\Auth\Authenticatable
$token string
return void

validateCredentials() public method

Validate a user against the given credentials.
public validateCredentials ( Illuminate\Contracts\Auth\Authenticatable $user, array $credentials ) : boolean
$user Illuminate\Contracts\Auth\Authenticatable
$credentials array
return boolean

validateResetCode() public method

Validate a password reset link
public validateResetCode ( $id, $code ) : Sentinel\DataTransferObjects\FailureResponse
$id
$code
return Sentinel\DataTransferObjects\FailureResponse

Property Details

$config protected property

protected $config

$dispatcher protected property

protected $dispatcher

$sentry protected property

protected $sentry