Commits

p2501  committed 0c2585f

get_user_by_mail returns an array

  • Participants
  • Parent commits 2133340

Comments (0)

Files changed (2)

File elgg/actions/user/requestnewpassword.php

 	$user = get_user_by_username($username);
 }else if($email){
 	$user = get_user_by_email($email);
+	$user = $user[0];
+	$mail = true;
 }
 
 if ($user) {
 		// event will display an appropriate message
 		trigger_elgg_event('validate', 'user', $user);
 	}
-} else {
-	register_error(sprintf(elgg_echo('user:username:notfound'), $username));
+} else{
+	if($mail){
+		register_error(sprintf(elgg_echo('user:email:notfound'),$email));	
+	}else{
+		register_error(sprintf(elgg_echo('user:username:notfound'), $username));
+	}
 }
 
 access_show_hidden_entities($access_status);

File elgg/languages/en.php

 	'user:language:fail' => "Your language settings could not be saved.",
 
 	'user:username:notfound' => 'Username %s not found.',
+	'user:email:notfound' => 'Email %s not found.',
+	'user:email:notvalidated' => 'User with email %s is not validated, therefore the password can not be changed.',
 
 	'user:password:lost' => 'Lost password',
 	'user:password:resetreq:success' => 'Successfully requested a new password, email sent',