Merge pull request #152 from faenir/master
Check enableEmailConfirmation
This commit is contained in:
@ -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',
|
||||
|
||||
@ -50,7 +50,7 @@ class RegistrationCest
|
||||
$I->see(Html::encode('This email address has already been taken'));
|
||||
|
||||
$this->register($I, 'tester@example.com', 'tester', 'tester');
|
||||
$I->see('Your account has been created and a message with further instructions has been sent to your email');
|
||||
$I->see('Your account has been created');
|
||||
$user = $I->grabRecord(User::className(), ['email' => 'tester@example.com']);
|
||||
$I->assertTrue($user->isConfirmed);
|
||||
|
||||
@ -96,7 +96,7 @@ class RegistrationCest
|
||||
]);
|
||||
$I->amOnRoute('/user/registration/register');
|
||||
$this->register($I, 'tester@example.com', 'tester');
|
||||
$I->see('Your account has been created and a message with further instructions has been sent to your email');
|
||||
$I->see('Your account has been created');
|
||||
$user = $I->grabRecord(User::className(), ['email' => 'tester@example.com']);
|
||||
$I->assertEquals('tester', $user->username);
|
||||
/** @var yii\swiftmailer\Message $message */
|
||||
|
||||
Reference in New Issue
Block a user