diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 02b52bf44a..c781b549e0 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -1380,7 +1380,7 @@ class AccountController extends BaseController $user->username = $user->email; $user->password = bcrypt($password); $user->registered = true; - $newUser->acceptLatestTerms($ip); + $user->acceptLatestTerms($ip); $user->save(); $user->account->startTrial(PLAN_PRO); diff --git a/app/Listeners/HandleUserSettingsChanged.php b/app/Listeners/HandleUserSettingsChanged.php index 3413812eab..c70275713d 100644 --- a/app/Listeners/HandleUserSettingsChanged.php +++ b/app/Listeners/HandleUserSettingsChanged.php @@ -44,10 +44,10 @@ class HandleUserSettingsChanged $users = $this->accountRepo->loadAccounts(Auth::user()->id); Session::put(SESSION_USER_ACCOUNTS, $users); - if ($event->user && $event->user->isEmailBeingChanged()) { + if ($event->user && $event->user->confirmed && $event->user->isEmailBeingChanged()) { $this->userMailer->sendConfirmation($event->user); $this->userMailer->sendEmailChanged($event->user); - + Session::flash('warning', trans('texts.verify_email')); } }