Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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  'email');
32  } else {
33  register_error(elgg_echo('admin:user:resetpassword:no'));
34  }
35 } else {
36  register_error(elgg_echo('admin:user:resetpassword:no'));
37 }
38 
elgg_get_site_entity($site_guid=0)
Get an entity (default is current site)
Definition: sites.php:18
$user
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
force_user_password_reset($user_guid, $password)
Low level function to reset a given user's password.
Definition: users.php:167
$guid
register_error($error)
Display an error on next page load.
Definition: elgglib.php:452
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
const REFERER
Definition: elgglib.php:2029
$password
Definition: login.php:25
forward($location="", $reason= 'system')
Forward to $location.
Definition: elgglib.php:93
notify_user($to, $from, $subject, $message, array $params=array(), $methods_override="")
Notify a user via their preferences.
generate_random_cleartext_password()
Generate a random 12 character clear text password.
Definition: users.php:189
system_message($message)
Display a system message on next page load.
Definition: elgglib.php:438
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:204