21 if (!function_exists(
'password_hash')) {
22 throw new RuntimeException(
'password_hash and associated functions are required.');
36 return password_needs_rehash($hash, PASSWORD_DEFAULT);
48 return password_verify($password, $hash);
59 return password_hash($password, PASSWORD_DEFAULT);
72 $user->passwd_conf_code =
$code;
73 $user->passwd_conf_time = time();
92 'action' =>
'requestnewpassword',
94 'ip_address' => $ip_address,
96 'apply_muting' =>
false,
97 'add_mute_link' =>
false,
122 $saved_code = $user->passwd_conf_code;
123 $code_time = (int) $user->passwd_conf_time;
124 $codes_match =
_elgg_services()->crypto->areEqual($saved_code, $conf_code);
126 if (!$saved_code || !$codes_match) {
131 if (!$code_time || $code_time < time() - 24 * 60 * 60) {
137 unset($user->passwd_conf_code);
138 unset($user->passwd_conf_time);
143 $action = $reset ?
'resetpassword' :
'changepassword';
152 'apply_muting' =>
false,
$params
Saves global plugin settings.
Exception thrown if an error which can only be found on runtime occurs.
needsRehash(string $hash)
Determine if the password hash needs to be rehashed.
elgg_generate_password()
Generate a random 12 character clear text password.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
generateHash(string $password)
Hash a password for storage using password_hash()
__construct()
Constructor.
requestNewPassword(\ElggUser $user)
Generate and send a password request email to a given user's registered email address.
if(!$item instanceof ElggEntity) $link
elgg_reset_authentication_failures(\ElggUser $user)
Clears all authentication failures for a give user.
saveNewPassword(\ElggUser $user, string $conf_code, string $password=null)
Validate and change password for a user.
if(!$user||!$user->canEdit()) $password
getLanguage(string $fallback=null)
Get user language or default to site language.
elgg_get_site_entity()
Get the current site entity.
verify(string $password, string $hash)
Verify a password against a hash using a timing attack resistant approach.
notify_user(int|array $to, int $from=0, string $subject= '', string $message= '', array $params=[], $methods_override=null)
Notify a user via their preferences.
setPassword(string $password)
Set the necessary metadata to store a hash of the user's password.
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
_elgg_services()
Get the global service provider.