minor fixes and user events docs

This commit is contained in:
Antonio Ramirez
2017-06-12 18:51:20 +02:00
parent 335a60383c
commit 4a80593435
10 changed files with 155 additions and 12 deletions

View File

@ -281,6 +281,7 @@ class AdminController extends Controller
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User block status has been updated.'));
} else {
Yii::$app->getSession()->setFlash('danger', Yii::t('usuario', 'Unable to update block status.'));
}
}

View File

@ -106,6 +106,7 @@ class RegistrationController extends Controller
$mailService = MailFactory::makeWelcomeMailerService($user);
if ($this->make(UserRegisterService::class, [$user, $mailService])->run()) {
Yii::$app->session->setFlash(
'info',
Yii::t(
@ -113,6 +114,7 @@ class RegistrationController extends Controller
'Your account has been created and a message with further instructions has been sent to your email'
)
);
$this->trigger(UserEvent::EVENT_AFTER_REGISTER, $event);
return $this->render(
'/shared/message',
@ -175,6 +177,7 @@ class RegistrationController extends Controller
public function actionConfirm($id, $code)
{
/** @var User $user */
$user = $this->userQuery->whereId($id)->one();
if ($user === null || $this->module->enableEmailConfirmation === false) {

View File

@ -137,7 +137,7 @@ class SettingsController extends Controller
{
/** @var SettingsForm $form */
$form = $this->make(SettingsForm::class);
$event = $this->make(FormEvent::class, [$form]);
$event = $this->make(UserEvent::class, [$form->getUser()]);
$this->make(AjaxRequestModelValidator::class, [$form])->validate();