Elgg
Version 6.1
|
Password service. More...
Public Member Functions | |
__construct () | |
Constructor. More... | |
needsRehash (string $hash) | |
Determine if the password hash needs to be rehashed. More... | |
verify (string $password, string $hash) | |
Verify a password against a hash using a timing attack resistant approach. More... | |
generateHash (string $password) | |
Hash a password for storage using password_hash() More... | |
requestNewPassword (\ElggUser $user) | |
Generate and send a password request email to a given user's registered email address. More... | |
saveNewPassword (\ElggUser $user, string $conf_code, string $password=null) | |
Validate and change password for a user. More... | |
Password service.
Definition at line 13 of file PasswordService.php.
Elgg\PasswordService::__construct | ( | ) |
Elgg\PasswordService::generateHash | ( | string | $password | ) |
Hash a password for storage using password_hash()
string | $password | Password in clear text |
Definition at line 58 of file PasswordService.php.
Elgg\PasswordService::needsRehash | ( | string | $hash | ) |
Determine if the password hash needs to be rehashed.
If the answer is true, after validating the password using password_verify, rehash it.
string | $hash | The hash to test |
Definition at line 35 of file PasswordService.php.
Elgg\PasswordService::requestNewPassword | ( | \ElggUser | $user | ) |
Generate and send a password request email to a given user's registered email address.
\ElggUser | $user | the user to notify |
Definition at line 69 of file PasswordService.php.
Elgg\PasswordService::saveNewPassword | ( | \ElggUser | $user, |
string | $conf_code, | ||
string | $password = null |
||
) |
Validate and change password for a user.
\ElggUser | $user | The user |
string | $conf_code | Confirmation code as sent in the request email. |
string | $password | Optional new password, if not randomly generated. |
Definition at line 114 of file PasswordService.php.
Elgg\PasswordService::verify | ( | string | $password, |
string | $hash | ||
) |
Verify a password against a hash using a timing attack resistant approach.
string | $password | The password to verify |
string | $hash | The hash to verify against |
Definition at line 47 of file PasswordService.php.