Methods summary
public
string
|
#
key( )
IndexableTrait > key()
Returns
string
|
public
User
|
#
setUsername( string $username )
Force a lowercase username
Force a lowercase username
Parameters
- $username
- The username (also the login name).
Returns
User Chainable
Throws
InvalidArgumentException If the username is not a string.
Implementation of
|
public
string
|
#
username( )
Returns
string
Implementation of
|
public
User
|
#
setEmail( string $email )
Parameters
Returns
User Chainable
Throws
InvalidArgumentException If the email is not a string.
Implementation of
|
public
string
|
#
email( )
Returns
string
Implementation of
|
public
Charcoal\User\UserInterface
|
#
setPassword( string|null $password )
Parameters
- $password
- The user password. Encrypted in storage.
Returns
Throws
InvalidArgumentException If the password is not a string (or null, to reset).
Implementation of
|
public
string
|
#
password( )
Returns
string
Implementation of
|
public
Charcoal\User\UserInterface
|
#
setActive( boolean $active )
Parameters
Returns
Overrides
Implementation of
|
public
boolean
|
#
active( )
Returns
boolean
Overrides
Implementation of
|
public
Charcoal\User\AbstractUser
|
#
setRoles( string|string[]|null $roles )
Parameters
- $roles
- The ACL roles this user belongs to.
Returns
Throws
InvalidArgumentException If the roles argument is invalid.
|
public
string[]
|
|
public
Charcoal\User\AbstractUser
|
#
setLastLoginDate( string|DateTimeInterface|null $lastLoginDate )
Parameters
- $lastLoginDate
- The last login date.
Returns
Throws
InvalidArgumentException If the ts is not a valid date/time.
Implementation of
|
public
DateTimeInterface|null
|
|
public
Charcoal\User\UserInterface
|
#
setLastLoginIp( string|integer|null $ip )
Parameters
- $ip
- The last login IP address.
Returns
Throws
InvalidArgumentException If the IP is not an IP string, an integer, or null.
Implementation of
|
public
string
|
#
lastLoginIp( )
Get the last login IP in x.x.x.x format
Get the last login IP in x.x.x.x format
Returns
string
Implementation of
|
public
Charcoal\User\UserInterface
|
#
setLastPasswordDate( string|DateTimeInterface|null $lastPasswordDate )
Parameters
- $lastPasswordDate
- The last password date.
Returns
Throws
InvalidArgumentException If the passsword date is not a valid DateTime.
Implementation of
|
public
DateTimeInterface|null
|
|
public
Charcoal\User\UserInterface
|
#
setLastPasswordIp( integer|string|null $ip )
Parameters
- $ip
- The last password IP.
Returns
Throws
InvalidArgumentException If the IP is not null, an integer or an IP string.
Implementation of
|
public
string
|
#
lastPasswordIp( )
Get the last password change IP in x.x.x.x format
Get the last password change IP in x.x.x.x format
Returns
string
Implementation of
|
public
Charcoal\User\UserInterface
|
#
setLoginToken( string $token )
Parameters
Returns
Throws
InvalidArgumentException If the token is not a string.
Implementation of
|
public
string
|
|
public
Charcoal\User\UserInterface
|
#
saveToSession( )
Returns
Throws
Exception If trying to save a user to session without a ID.
|
public
boolean
|
#
login( )
Log in the user (in session)
Log in the user (in session)
Called when the authentication is successful.
Returns
boolean Success / Failure
|
public
boolean
|
|
public
|
#
loginFailed( string $username )
Failed authentication callback
Failed authentication callback
Parameters
- $username
- The failed username.
|
public
boolean
|
#
logLoginFailed( string $username )
Parameters
- $username
- The username to log failure.
Returns
boolean
|
public
boolean
|
#
logout( )
Empties the session var associated to the session key.
Empties the session var associated to the session key.
Returns
boolean Logged out or not.
|
public
Charcoal\User\UserInterface
|
#
resetPassword( string $plainPassword )
Reset the password.
Encrypt the password and re-save the object in the database.
Also updates the last password date & ip.
Parameters
- $plainPassword
- The plain (non-encrypted) password to reset to.
Returns
Throws
InvalidArgumentException If the plain password is not a string.
Implementation of
|
public static
Charcoal\User\UserInterface |null
|
#
getAuthenticated( Charcoal\Factory\FactoryInterface $factory )
Get the currently authenticated user (from session)
Get the currently authenticated user (from session)
Return null if there is no current user in logged into
Parameters
- $factory
- The factory to create the user object with.
Returns
Throws
Exception If the user from session is invalid.
|