Class

eZ\Publish\Core\MVC\Symfony\Security\User

class User implements ReferenceUserInterface, EquatableInterface

Methods

__construct(User $user = null, array $roles = array())

Role[] getRoles()

Returns the roles granted to the user.

string getPassword()

Returns the password used to authenticate the user.

string getSalt()

Returns the salt that was originally used to encode the password.

string getUsername()

Returns the username used to authenticate the user.

eraseCredentials()

Removes sensitive data from the user.

UserReference getAPIUserReference()

User getAPIUser()

setAPIUser(User $user)

isEqualTo(UserInterface $user)

__toString()

bool isAccountNonExpired()

Checks whether the user's account has expired.

bool isAccountNonLocked()

Checks whether the user is locked.

bool isCredentialsNonExpired()

Checks whether the user's credentials (password) has expired.

bool isEnabled()

Checks whether the user is enabled.

array __sleep()

Make sure we don't serialize the whole API user object given it's a full fledged api content object.

Details

at line 33
public __construct(User $user = null, array $roles = array())

Parameters

User $user
array $roles

at line 56
public Role[] getRoles()

Returns the roles granted to the user.

public function getRoles() { return array( 'ROLE_USER' ); }

Alternatively, the roles might be stored on a roles property, and populated in any number of different ways when the user object is created.

Return Value

Role[] The user roles

at line 69
public string getPassword()

Returns the password used to authenticate the user.

This should be the encoded password. On authentication, a plain-text password will be salted, encoded, and then compared to this value.

Return Value

string The password

at line 81
public string getSalt()

Returns the salt that was originally used to encode the password.

This can return null if the password was not encoded using a salt.

Return Value

string The salt

at line 91
public string getUsername()

Returns the username used to authenticate the user.

Return Value

string The username

at line 102
public eraseCredentials()

Removes sensitive data from the user.

This is important if, at any given point, sensitive information like the plain-text password is stored on this object.

at line 109
public UserReference getAPIUserReference()

Return Value

UserReference

at line 117
public User getAPIUser()

Return Value

User

at line 131
public setAPIUser(User $user)

Parameters

User $user

at line 137
public isEqualTo(UserInterface $user)

Parameters

UserInterface $user

at line 149
public __toString()

at line 164
public bool isAccountNonExpired()

Checks whether the user's account has expired.

Internally, if this method returns false, the authentication system will throw an AccountExpiredException and prevent login.

Return Value

bool true if the user's account is non expired, false otherwise

See also

AccountExpiredException

at line 179
public bool isAccountNonLocked()

Checks whether the user is locked.

Internally, if this method returns false, the authentication system will throw a LockedException and prevent login.

Return Value

bool true if the user is not locked, false otherwise

See also

LockedException

at line 194
public bool isCredentialsNonExpired()

Checks whether the user's credentials (password) has expired.

Internally, if this method returns false, the authentication system will throw a CredentialsExpiredException and prevent login.

Return Value

bool true if the user's credentials are non expired, false otherwise

See also

CredentialsExpiredException

at line 209
public bool isEnabled()

Checks whether the user is enabled.

Internally, if this method returns false, the authentication system will throw a DisabledException and prevent login.

Return Value

bool true if the user is enabled, false otherwise

See also

DisabledException

at line 221
public array __sleep()

Make sure we don't serialize the whole API user object given it's a full fledged api content object.

We set (& either way refresh) the user object in \eZ\Publish\Core\MVC\Symfony\Security\User\Provider->refreshUser() when object wakes back up from session.

Return Value

array