Merged in bugfix/MAPG-69-dont-resend-welcome-email (pull request #125)
MAPG-69 welcome email shouldn't be sent to existing user
This commit is contained in:
commit
d96ac938f8
@ -273,8 +273,12 @@ class LoginController
|
|||||||
$user = $this->userRepository->getByEmail($userData['email']);
|
$user = $this->userRepository->getByEmail($userData['email']);
|
||||||
|
|
||||||
if ($user === null) {
|
if ($user === null) {
|
||||||
|
$sendWelcomeEmail = true;
|
||||||
|
|
||||||
$user = new User();
|
$user = new User();
|
||||||
$user->setEmail($userData['email']);
|
$user->setEmail($userData['email']);
|
||||||
|
} else {
|
||||||
|
$sendWelcomeEmail = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->setActive(true);
|
$user->setActive(true);
|
||||||
@ -282,7 +286,9 @@ class LoginController
|
|||||||
|
|
||||||
$this->pdm->saveToDb($user);
|
$this->pdm->saveToDb($user);
|
||||||
|
|
||||||
|
if ($sendWelcomeEmail) {
|
||||||
$this->sendWelcomeEmail($user->getEmail());
|
$this->sendWelcomeEmail($user->getEmail());
|
||||||
|
}
|
||||||
|
|
||||||
$this->request->session()->delete('google_user_data');
|
$this->request->session()->delete('google_user_data');
|
||||||
$this->request->setUser($user);
|
$this->request->setUser($user);
|
||||||
|
Loading…
Reference in New Issue
Block a user