PHP Interface Stevemo\Cpanel\User\Repo\CpanelUserInterface

显示文件 Open project: stevemo/cpanel Interface Usage Examples

Public Methods

Method Description
activate ( $id ) : boolean Activate a user
authenticate ( array $credentials, boolean $remember = false ) : Cartalyst\Sentry\Users\UserInterface Attempts to authenticate the given user according to the passed credentials.
check ( ) : boolean Check to see if the user is logged in and activated, and hasn't been banned or suspended.
create ( array $credentials, boolean $activate = false ) : Cartalyst\Sentry\Users\UserInterface Create a new user
deactivate ( $id ) : boolean De activate a user
delete ( integer $id ) : void Delete the user
findAll ( ) : array Returns an all users.
findById ( $id ) : Cartalyst\Sentry\Users\UserInterface Finds a user by the given user ID.
findByLogin ( $login ) : Cartalyst\Sentry\Users\UserInterface Find a given user by the login attribute
getEmptyUser ( ) : StdClass Returns an empty user object.
getUser ( ) : mixed | Cartalyst\Sentry\Users\UserInterface Returns the current user being used by Sentry, if any.
getUserThrottle ( $id ) : Cartalyst\Sentry\Throttling\ThrottleInterface Get the throttle provider for a given user
logout ( ) : void Logs the current user out.
register ( array $credentials, boolean $activate = false ) : Cartalyst\Sentry\Users\UserInterface Registers a user by giving the required credentials and an optional flag for whether to activate the user.
resetPassword ( $code, $password ) : Cartalyst\Sentry\Users\UserInterface Reset a given user password
update ( $id, array $attributes ) : Cartalyst\Sentry\Users\UserInterface Update user information
updatePermissions ( integer $id, array $permissions ) : Cartalyst\Sentry\Users\UserInterface Update permissions for a given user
updateThrottleStatus ( $id, $status ) : void

Method Details

activate() public method

Activate a user
Author: Steve Montambeault
public activate ( $id ) : boolean
$id
return boolean

authenticate() public method

Attempts to authenticate the given user according to the passed credentials.
Author: Steve Montambeault
public authenticate ( array $credentials, boolean $remember = false ) : Cartalyst\Sentry\Users\UserInterface
$credentials array
$remember boolean
return Cartalyst\Sentry\Users\UserInterface

check() public method

Check to see if the user is logged in and activated, and hasn't been banned or suspended.
Author: Steve Montambeault
public check ( ) : boolean
return boolean

create() public method

Create a new user
Author: Steve Montambeault
public create ( array $credentials, boolean $activate = false ) : Cartalyst\Sentry\Users\UserInterface
$credentials array
$activate boolean
return Cartalyst\Sentry\Users\UserInterface

deactivate() public method

De activate a user
Author: Steve Montambeault
public deactivate ( $id ) : boolean
$id
return boolean

delete() public method

Delete the user
Author: Steve Montambeault
public delete ( integer $id ) : void
$id integer
return void

findAll() public method

Returns an all users.
Author: Steve Montambeault
public findAll ( ) : array
return array

findById() public method

Finds a user by the given user ID.
Author: Steve Montambeault
public findById ( $id ) : Cartalyst\Sentry\Users\UserInterface
$id
return Cartalyst\Sentry\Users\UserInterface

findByLogin() public method

Find a given user by the login attribute
Author: Steve Montambeault
public findByLogin ( $login ) : Cartalyst\Sentry\Users\UserInterface
$login
return Cartalyst\Sentry\Users\UserInterface

getEmptyUser() public method

Returns an empty user object.
Author: Steve Montambeault
public getEmptyUser ( ) : StdClass
return StdClass

getUser() public method

Returns the current user being used by Sentry, if any.
Author: Steve Montambeault
public getUser ( ) : mixed | Cartalyst\Sentry\Users\UserInterface
return mixed | Cartalyst\Sentry\Users\UserInterface

getUserThrottle() public method

Get the throttle provider for a given user
Author: Steve Montambeault
public getUserThrottle ( $id ) : Cartalyst\Sentry\Throttling\ThrottleInterface
$id
return Cartalyst\Sentry\Throttling\ThrottleInterface

logout() public method

Logs the current user out.
Author: Steve Montambeault
public logout ( ) : void
return void

register() public method

Registers a user by giving the required credentials and an optional flag for whether to activate the user.
Author: Steve Montambeault
public register ( array $credentials, boolean $activate = false ) : Cartalyst\Sentry\Users\UserInterface
$credentials array
$activate boolean
return Cartalyst\Sentry\Users\UserInterface

resetPassword() public method

Reset a given user password
Author: Steve Montambeault
public resetPassword ( $code, $password ) : Cartalyst\Sentry\Users\UserInterface
$code
$password
return Cartalyst\Sentry\Users\UserInterface

update() public method

Update user information
Author: Steve Montambeault
public update ( $id, array $attributes ) : Cartalyst\Sentry\Users\UserInterface
$id
$attributes array
return Cartalyst\Sentry\Users\UserInterface

updatePermissions() public method

Update permissions for a given user
Author: Steve Montambeault
public updatePermissions ( integer $id, array $permissions ) : Cartalyst\Sentry\Users\UserInterface
$id integer
$permissions array
return Cartalyst\Sentry\Users\UserInterface

updateThrottleStatus() public method

Author: Steve Montambeault
public updateThrottleStatus ( $id, $status ) : void
$id
$status
return void