Skip to content

Commit

Permalink
Revert "Better use of $email_change so that sendAdminNotifications is…
Browse files Browse the repository at this point in the history
… used when necessary - fixes #2104"

This reverts commit 13f8045.
The commit din't actually fix the issue that needs more work.

Signed-off-by: emanuele <emanuele45@gmail.com>
  • Loading branch information
emanuele45 committed Aug 23, 2015
1 parent c98b57d commit 1d2250f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions sources/controllers/Register.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,6 @@ public function action_activate()
return;
}

// Let's assume it's an email change until proven otherwise
$email_change = true;

// Change their email address? (they probably tried a fake one first :P.)
if (isset($_POST['new_email'], $_REQUEST['passwd']) && validateLoginPassword($_REQUEST['passwd'], $row['passwd'], $row['member_name'], true) && ($row['is_activated'] == 0 || $row['is_activated'] == 2))
{
Expand All @@ -673,8 +670,7 @@ public function action_activate()
updateMemberData($row['id_member'], array('email_address' => $_POST['new_email']));
$row['email_address'] = $_POST['new_email'];

// If we are here, it's not an email change, but it will use the rest of the controller
$email_change = false;
$email_change = true;
}

// Resend the password, but only if the account wasn't activated yet.
Expand All @@ -700,7 +696,7 @@ public function action_activate()
// This will ensure we don't actually get an error message if it works!
$context['error_title'] = '';

fatal_lang_error($email_change ? 'change_email_success' : 'resend_email_success', false);
fatal_lang_error(!empty($email_change) ? 'change_email_success' : 'resend_email_success', false);
}

// Quit if this code is not right.
Expand Down Expand Up @@ -728,7 +724,7 @@ public function action_activate()
// Also do a proper member stat re-evaluation.
updateStats('member', false);

if (!isset($_POST['new_email']) && !$email_change)
if (!isset($_POST['new_email']))
{
require_once(SUBSDIR . '/Notification.subs.php');
sendAdminNotifications('activation', $row['id_member'], $row['member_name']);
Expand Down

0 comments on commit 1d2250f

Please sign in to comment.