From 4928df077017b345dd39bcd935d593cc3acf00bd Mon Sep 17 00:00:00 2001 From: Arthur Khachaturov Date: Fri, 9 Feb 2018 15:41:15 +0300 Subject: [PATCH] Check enableEmailConfirmation --- src/User/Controller/RegistrationController.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/User/Controller/RegistrationController.php b/src/User/Controller/RegistrationController.php index 2834f9d..8c97bce 100644 --- a/src/User/Controller/RegistrationController.php +++ b/src/User/Controller/RegistrationController.php @@ -106,13 +106,17 @@ class RegistrationController extends Controller $mailService = MailFactory::makeWelcomeMailerService($user); if ($this->make(UserRegisterService::class, [$user, $mailService])->run()) { - Yii::$app->session->setFlash( - 'info', - Yii::t( - 'usuario', - 'Your account has been created and a message with further instructions has been sent to your email' - ) - ); + if ($this->module->enableEmailConfirmation) { + Yii::$app->session->setFlash( + 'info', + Yii::t( + 'usuario', + 'Your account has been created and a message with further instructions has been sent to your email' + ) + ); + } else { + Yii::$app->session->setFlash('info', Yii::t('usuario', 'Your account has been created')); + } $this->trigger(FormEvent::EVENT_AFTER_REGISTER, $event); return $this->render( '/shared/message',