User
class User (View source)
The User type is a custom data type that stores all data that is related to a user.
Properties
The user's email. | |||
$name | The username. | ||
private | $passwordHash | The encrypted password. |
Methods
__construct(string $name, string $password, string $email = '')
The constructor.
array
__serialize()
Serialize object.
__unserialize(array $properties)
Unserialize object.
string
getPasswordHash()
Get a hashed version of a user password.
setPasswordHash(string $password)
Store a hashed version of a given clear text password.
bool
verifyPassword(string $password)
Verify if a password matches its saved hashed version.
string
hash(string $password)
Create hash from password to store in accounts.txt.
Details
at line 71
__construct(string $name, string $password, string $email = '')
The constructor.
at line 82
array
__serialize()
Serialize object.
at line 95
__unserialize(array $properties)
Unserialize object.
at line 108
string
getPasswordHash()
Get a hashed version of a user password.
at line 117
setPasswordHash(string $password)
Store a hashed version of a given clear text password.
at line 127
bool
verifyPassword(string $password)
Verify if a password matches its saved hashed version.
at line 139
private string
hash(string $password)
Create hash from password to store in accounts.txt.