From 53209d2d78530c8ba0698cbcd170c1919fed0c41 Mon Sep 17 00:00:00 2001 From: Lorenzo Milesi Date: Fri, 9 Feb 2018 08:45:39 +0100 Subject: [PATCH] =?UTF-8?q?Honor=20`enableFlashMessages`=C2=A0config=20par?= =?UTF-8?q?am=20in=20`PasswordRecoveryService`=20#110?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/User/Service/PasswordRecoveryService.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efd711b..5925824 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Enh #143: Introduced "conflict" configuration in composer.json (maxxer) - Enh #145: Allowed the `+` sign in username (maxxer) - Bug #9: Documentation about migration from Dektrium tools (maxxer) +- Bug #110: Honor `enableFlashMessages` in `PasswordRecoveryService` (maxxer) ## 1.1.1 - November 27, 2017 - Bug #115: Convert client_id to string because pgsql fail with type convertion (Dezinger) diff --git a/src/User/Service/PasswordRecoveryService.php b/src/User/Service/PasswordRecoveryService.php index 5f319b0..032257e 100644 --- a/src/User/Service/PasswordRecoveryService.php +++ b/src/User/Service/PasswordRecoveryService.php @@ -16,12 +16,14 @@ use Da\User\Factory\TokenFactory; use Da\User\Model\User; use Da\User\Query\UserQuery; use Da\User\Traits\MailAwareTrait; +use Da\User\Traits\ModuleAwareTrait; use Exception; use Yii; class PasswordRecoveryService implements ServiceInterface { use MailAwareTrait; + use ModuleAwareTrait; protected $query; @@ -58,10 +60,12 @@ class PasswordRecoveryService implements ServiceInterface return false; } - Yii::$app->session->setFlash( - 'info', - Yii::t('usuario', 'An email has been sent with instructions for resetting your password') - ); + if ($this->getModule()->enableFlashMessages == true) { + Yii::$app->session->setFlash( + 'info', + Yii::t('usuario', 'An email has been sent with instructions for resetting your password') + ); + } return true; } catch (Exception $e) {