Elgg  Version 2.3
resetpassword.php
Go to the documentation of this file.
1 <?php
17 $guid = get_input('guid');
19 
20 if (($user instanceof ElggUser) && ($user->canEdit())) {
22 
24  system_message(elgg_echo('admin:user:resetpassword:yes'));
25 
26  notify_user($user->guid,
27  elgg_get_site_entity()->guid,
28  elgg_echo('email:resetpassword:subject', array(), $user->language),
29  elgg_echo('email:resetpassword:body', array($user->username, $password), $user->language),
30  array(
31  'object' => $user,
32  'action' => 'resetpassword',
33  'password' => $password,
34  ),
35  'email');
36  } else {
37  register_error(elgg_echo('admin:user:resetpassword:no'));
38  }
39 } else {
40  register_error(elgg_echo('admin:user:resetpassword:no'));
41 }
42 
$password
Definition: login.php:25
register_error($error)
Display an error on next page load.
Definition: elgglib.php:464
system_message($message)
Display a system message on next page load.
Definition: elgglib.php:450
const REFERER
Definition: elgglib.php:2123
forward($location="", $reason='system')
Forward to $location.
Definition: elgglib.php:94
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:204
elgg_echo($message_key, $args=array(), $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=array(), $methods_override=null)
Notify a user via their preferences.
$user
$guid
elgg_get_site_entity($site_guid=0)
Get an \ElggSite entity (default is current site)
Definition: sites.php:18
force_user_password_reset($user_guid, $password)
Low level function to reset a given user's password.
Definition: users.php:167
generate_random_cleartext_password()
Generate a random 12 character clear text password.
Definition: users.php:189