Elgg  Version 3.0
resetpassword.php
Go to the documentation of this file.
1 <?php
14 $guid = (int) get_input('guid');
16 
17 if (!$user || !$user->canEdit()) {
18  return elgg_error_response(elgg_echo('admin:user:resetpassword:no'));
19 }
20 
22 
24  return elgg_error_response(elgg_echo('admin:user:resetpassword:no'));
25 }
26 
27 notify_user($user->guid,
28  elgg_get_site_entity()->guid,
29  elgg_echo('email:resetpassword:subject', [], $user->language),
30  elgg_echo('email:resetpassword:body', [$user->username, $password], $user->language),
31  [
32  'object' => $user,
33  'action' => 'resetpassword',
34  'password' => $password,
35  ],
36  'email');
37 
38 return elgg_ok_response('', elgg_echo('admin:user:resetpassword:yes'));
force_user_password_reset($user_guid, $password)
Low level function to reset a given user&#39;s password.
Definition: users.php:124
$user
get_user($guid)
Get a user object from a GUID.
Definition: users.php:40
$guid
Reset a user&#39;s password.
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
notify_user($to, $from=0, $subject= '', $message= '', array $params=[], $methods_override=null)
Notify a user via their preferences.
if(!$user||!$user->canEdit()) $password
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_error_response($error= '', $forward_url=REFERRER, $status_code=ELGG_HTTP_OK)
Prepare an error response to be returned by a page or an action handler.
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:130
elgg_ok_response($content= '', $message= '', $forward_url=null, $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
generate_random_cleartext_password()
Generate a random 12 character clear text password.
Definition: users.php:146