Elgg  Version 6.1
requestnewpassword.php
Go to the documentation of this file.
1 <?php
6 $username = get_input('username');
7 if (empty($username)) {
8  return elgg_error_response(elgg_echo('error:missing_data'));
9 }
10 
11 // also allow by email addresses
13 if (!$user instanceof \ElggUser) {
14  return elgg_error_response(elgg_echo('user:username:notfound', [$username]));
15 }
16 
18 
19 return elgg_ok_response('', elgg_echo('user:password:changereq:success'), '');
if(empty($username)) $user
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_get_user_by_username(string $username, bool $try_email=false)
Get a user by username.
Definition: users.php:31
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_error_response(string|array $message= '', string $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
$username
Action to request a new password.
elgg_request_new_password(\ElggUser $user)
Generate and send a password request email to a given user&#39;s registered email address.
Definition: users.php:108