|
Elgg
Version 1.10
|
Public Member Functions | |
| __construct () | |
| Constructor. More... | |
| needsRehash ($hash) | |
| Determine if the password hash needs to be rehashed. More... | |
| verify ($password, $hash) | |
| Verify a password against a hash using a timing attack resistant approach. More... | |
| generateHash ($password) | |
| Hash a password for storage using password_hash() More... | |
| generateLegacyHash (\ElggUser $user, $password) | |
| Hash a password for storage. More... | |
| sendNewPasswordRequest ($user_guid) | |
| Generate and send a password request email to a given user's registered email address. More... | |
| forcePasswordReset ($user, $password) | |
| Set a user's new password and save the entity. More... | |
| executeNewPasswordReset ($user_guid, $conf_code, $password=null) | |
| Validate and change password for a user. More... | |
Definition at line 11 of file PasswordService.php.
| Elgg\PasswordService::__construct | ( | ) |
Constructor.
Definition at line 16 of file PasswordService.php.
| Elgg\PasswordService::executeNewPasswordReset | ( | $user_guid, | |
| $conf_code, | |||
$password = null |
|||
| ) |
Validate and change password for a user.
| int | $user_guid | The user id |
| string | $conf_code | Confirmation code as sent in the request email. |
| string | $password | Optional new password, if not randomly generated. |
Definition at line 139 of file PasswordService.php.
| Elgg\PasswordService::forcePasswordReset | ( | $user, | |
| $password | |||
| ) |
Set a user's new password and save the entity.
This can only be called from execute_new_password_request().
| \ElggUser | int | $user | The user GUID or entity |
| string | $password | Text (which will then be converted into a hash and stored) |
Definition at line 113 of file PasswordService.php.
| Elgg\PasswordService::generateHash | ( | $password | ) |
Hash a password for storage using password_hash()
| string | $password | Password in clear text |
Definition at line 54 of file PasswordService.php.
| Elgg\PasswordService::generateLegacyHash | ( | \ElggUser | $user, |
| $password | |||
| ) |
Hash a password for storage.
Currently salted MD5.
| \ElggUser | $user | The user this is being generated for. |
| string | $password | Password in clear text |
Definition at line 66 of file PasswordService.php.
| Elgg\PasswordService::needsRehash | ( | $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 31 of file PasswordService.php.
| Elgg\PasswordService::sendNewPasswordRequest | ( | $user_guid | ) |
Generate and send a password request email to a given user's registered email address.
| int | $user_guid | User GUID |
Definition at line 77 of file PasswordService.php.
| Elgg\PasswordService::verify | ( | $password, | |
| $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 43 of file PasswordService.php.