Elgg  Version 3.0
changepassword.php
Go to the documentation of this file.
1 <?php
6 $password = get_input('password1');
7 $password_repeat = get_input('password2');
8 $user_guid = (int) get_input('u');
9 $code = get_input('c');
10 
11 try {
13 } catch (RegistrationException $e) {
14  return elgg_error_response($e->getMessage());
15 }
16 
18  return elgg_error_response(elgg_echo('RegistrationException:PasswordMismatch'));
19 }
20 
22  return elgg_error_response(elgg_echo('user:password:fail'));
23 }
24 
25 try {
27 } catch (LoginException $e) {
28  return elgg_error_response($e->getMessage());
29 }
30 
31 return elgg_ok_response('', elgg_echo('user:password:success'), '');
$user_guid
get_user($guid)
Get a user object from a GUID.
Definition: users.php:40
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$code
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$password
Action to reset a password, send success email, and log the user in.
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.
validate_password($password)
Simple validation of a password.
Definition: users.php:173
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.
$password_repeat
login(\ElggUser $user, $persistent=false)
Logs in a specified .
Definition: sessions.php:273
execute_new_password_request($user_guid, $conf_code, $password=null)
Validate and change password for a user.
Definition: users.php:137