Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #472 from milkyway-git/patch-2
Browse files Browse the repository at this point in the history
Check for mail address when checking forgotten password
  • Loading branch information
zegenie committed Nov 15, 2016
2 parents 132931c + 1fbcd73 commit 8929126
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/mailing/controllers/Main.php
Expand Up @@ -21,10 +21,15 @@ public function runForgot(framework\Request $request)

try
{
$username = str_replace('%2E', '.', $request['forgot_password_username']);
if (!empty($username))
$username_or_email = str_replace('%2E', '.', $request['forgot_password_username']);
if (!empty($username_or_email))
{
if (($user = \thebuggenie\core\entities\User::getByUsername($username)) instanceof \thebuggenie\core\entities\User)
$user = \thebuggenie\core\entities\User::getByUsername($username_or_email);
if (!$user instanceof \thebuggenie\core\entities\User)
{
$user = \thebuggenie\core\entities\User::getByEmail($username_or_email);
}
if ($user instanceof \thebuggenie\core\entities\User)
{
if ($user->isActivated() && $user->isEnabled() && !$user->isDeleted())
{
Expand Down

0 comments on commit 8929126

Please sign in to comment.