aboutsummaryrefslogtreecommitdiff
path: root/actions/user
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-11-19 07:45:33 -0500
committerCash Costello <cash.costello@gmail.com>2011-11-19 07:45:33 -0500
commit7cc4c3139d8d75335bd7e9b21d99257ff8d3cc72 (patch)
treef8688102de01d684ac09ee660c3e9923b4c8ae8b /actions/user
parent75c00c55dd9cc2de4d97f829d9b47c99eb4ba287 (diff)
downloadelgg-7cc4c3139d8d75335bd7e9b21d99257ff8d3cc72.tar.gz
elgg-7cc4c3139d8d75335bd7e9b21d99257ff8d3cc72.tar.bz2
Fixes #641 users can submit email address to reset password
Diffstat (limited to 'actions/user')
-rw-r--r--actions/user/requestnewpassword.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/actions/user/requestnewpassword.php b/actions/user/requestnewpassword.php
index 5dfa24952..f1d4fa43c 100644
--- a/actions/user/requestnewpassword.php
+++ b/actions/user/requestnewpassword.php
@@ -8,6 +8,11 @@
$username = get_input('username');
+// allow email addresses
+if (strpos($username, '@') !== false && ($users = get_user_by_email($username))) {
+ $username = $users[0]->username;
+}
+
$user = get_user_by_username($username);
if ($user) {
if (send_new_password_request($user->guid)) {