From 20a58bb1d44f5dd61e736b3c2ca9d07e25127eb2 Mon Sep 17 00:00:00 2001 From: "E.Alamo" Date: Sun, 15 Oct 2017 22:40:46 +0200 Subject: [PATCH 001/108] External links should open in a new tab|window The gravatar link makes user leave the page without saving changes. Opening in a new tab prevent this. --- src/User/resources/views/settings/profile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/User/resources/views/settings/profile.php b/src/User/resources/views/settings/profile.php index 9cfaf8e..a058259 100644 --- a/src/User/resources/views/settings/profile.php +++ b/src/User/resources/views/settings/profile.php @@ -71,7 +71,8 @@ $timezoneHelper = $model->make(TimezoneHelper::class); ->hint( Html::a( Yii::t('usuario', 'Change your avatar at Gravatar.com'), - 'http://gravatar.com' + 'http://gravatar.com', + ['target' => '_blank'] ) ) ?> From 1fa2e5b66df04e3c1da8c34b85f3a8cfdd73f627 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 15 Oct 2017 23:00:21 +0200 Subject: [PATCH 002/108] Close #23 provide administrator with an option for user to reset its password. --- CHANGELOG.md | 1 + docs/installation/configuration-options.md | 5 ++++ src/User/Controller/AdminController.php | 27 ++++++++++++++++++---- src/User/Controller/RecoveryController.php | 2 +- src/User/Module.php | 4 ++++ src/User/resources/i18n/ca/usuario.php | 3 +++ src/User/resources/i18n/da/usuario.php | 3 +++ src/User/resources/i18n/de-DU/usuario.php | 3 +++ src/User/resources/i18n/de/usuario.php | 3 +++ src/User/resources/i18n/es/usuario.php | 13 +++++++---- src/User/resources/i18n/fa-IR/usuario.php | 3 +++ src/User/resources/i18n/fi/usuario.php | 3 +++ src/User/resources/i18n/fr/usuario.php | 3 +++ src/User/resources/i18n/hr/usuario.php | 3 +++ src/User/resources/i18n/hu/usuario.php | 3 +++ src/User/resources/i18n/it/usuario.php | 3 +++ src/User/resources/i18n/kk/usuario.php | 3 +++ src/User/resources/i18n/lt/usuario.php | 3 +++ src/User/resources/i18n/nl/usuario.php | 3 +++ src/User/resources/i18n/pl/usuario.php | 3 +++ src/User/resources/i18n/pt-BR/usuario.php | 3 +++ src/User/resources/i18n/pt-PT/usuario.php | 3 +++ src/User/resources/i18n/ro/usuario.php | 3 +++ src/User/resources/i18n/ru/usuario.php | 3 +++ src/User/resources/i18n/th/usuario.php | 3 +++ src/User/resources/i18n/tr_TR/usuario.php | 3 +++ src/User/resources/i18n/uk/usuario.php | 3 +++ src/User/resources/i18n/vi/usuario.php | 3 +++ src/User/resources/i18n/zh-CN/usuario.php | 3 +++ src/User/resources/views/admin/index.php | 20 +++++++++++++++- 30 files changed, 130 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66e6cc0..cdb3774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## 1.0.14 - Work in progress +- Enh #23: Provide administrator with an option to reset user password (tonydspaniard) - Enh #55: Provide google recaptcha mechanism (tonydspaniard) - Fix #20: Allow the assignment of a role on user creation via console (tonydspaniard) - Fix #59: Add instructions to add rbac migration path (tonydspaniard) diff --git a/docs/installation/configuration-options.md b/docs/installation/configuration-options.md index 99bc29c..2519ef2 100644 --- a/docs/installation/configuration-options.md +++ b/docs/installation/configuration-options.md @@ -43,6 +43,11 @@ If `true` it will allow users to login with unconfirmed emails. If `true` it will enable password recovery process. +#### allowAdminPasswordRecovery (type: `boolean`, default: `true`) + +If `true` and `allowPasswordRecovery` is false, it will enable administrator to send a password recovery email to a +user. + #### allowAccountDelete (type: `boolean`, default: `true`) If `true` users will be able to remove their own accounts. diff --git a/src/User/Controller/AdminController.php b/src/User/Controller/AdminController.php index 57cce4f..83d74fb 100644 --- a/src/User/Controller/AdminController.php +++ b/src/User/Controller/AdminController.php @@ -18,6 +18,7 @@ use Da\User\Model\Profile; use Da\User\Model\User; use Da\User\Query\UserQuery; use Da\User\Search\UserSearch; +use Da\User\Service\PasswordRecoveryService; use Da\User\Service\SwitchIdentityService; use Da\User\Service\UserBlockService; use Da\User\Service\UserConfirmationService; @@ -44,10 +45,10 @@ class AdminController extends Controller /** * AdminController constructor. * - * @param string $id - * @param Module $module + * @param string $id + * @param Module $module * @param UserQuery $userQuery - * @param array $config + * @param array $config */ public function __construct($id, Module $module, UserQuery $userQuery, array $config = []) { @@ -81,7 +82,8 @@ class AdminController extends Controller 'delete' => ['post'], 'confirm' => ['post'], 'block' => ['post'], - 'switch-identity' => ['post'] + 'switch-identity' => ['post'], + 'password-reset' => ['post'] ], ], 'access' => [ @@ -309,4 +311,21 @@ class AdminController extends Controller return $this->goHome(); } + + public function actionPasswordReset($id) + { + /** @var User $user */ + $user = $this->userQuery->where(['id' => $id])->one(); + $mailService = MailFactory::makeRecoveryMailerService($user->email); + if ($this->make(PasswordRecoveryService::class, [$user->email, $mailService])->run()) { + Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'Recovery message sent')); + } else { + Yii::$app->getSession()->setFlash( + 'danger', + Yii::t('usuario', 'Unable to send recovery message to the user') + ); + } + + return $this->redirect(['index']); + } } diff --git a/src/User/Controller/RecoveryController.php b/src/User/Controller/RecoveryController.php index ad1f931..1e8e86d 100644 --- a/src/User/Controller/RecoveryController.php +++ b/src/User/Controller/RecoveryController.php @@ -123,7 +123,7 @@ class RecoveryController extends Controller */ public function actionReset($id, $code) { - if (!$this->module->allowPasswordRecovery) { + if (!$this->module->allowPasswordRecovery && !$this->module->allowAdminPasswordRecovery) { throw new NotFoundHttpException(); } /** @var Token $token */ diff --git a/src/User/Module.php b/src/User/Module.php index 2ab8e72..53b54b5 100644 --- a/src/User/Module.php +++ b/src/User/Module.php @@ -56,6 +56,10 @@ class Module extends BaseModule * @var bool whether to enable password recovery or not */ public $allowPasswordRecovery = true; + /** + * @var bool whether to enable password recovery from the admin console + */ + public $allowAdminPasswordRecovery = true; /** * @var bool whether user can remove his account */ diff --git a/src/User/resources/i18n/ca/usuario.php b/src/User/resources/i18n/ca/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/ca/usuario.php +++ b/src/User/resources/i18n/ca/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/da/usuario.php b/src/User/resources/i18n/da/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/da/usuario.php +++ b/src/User/resources/i18n/da/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/de-DU/usuario.php b/src/User/resources/i18n/de-DU/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/de-DU/usuario.php +++ b/src/User/resources/i18n/de-DU/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/de/usuario.php b/src/User/resources/i18n/de/usuario.php index b8d9cdf..389702b 100644 --- a/src/User/resources/i18n/de/usuario.php +++ b/src/User/resources/i18n/de/usuario.php @@ -19,6 +19,7 @@ return [ 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Authentication rule class {0} can not be instantiated' => '', 'Authorization rule has been added.' => '', 'Authorization rule has been removed.' => '', @@ -48,6 +49,7 @@ return [ 'Rule {0} not found.' => '', 'Rules' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Switch identities is disabled.' => '', 'The "recaptcha" component must be configured.' => '', 'The verification code is incorrect.' => '', @@ -61,6 +63,7 @@ return [ 'Two-factor code' => '', 'Unable to create new authorization rule.' => '', 'Unable to disable two-factor authorization.' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization rule.' => '', 'Update rule' => '', 'Updated at' => '', diff --git a/src/User/resources/i18n/es/usuario.php b/src/User/resources/i18n/es/usuario.php index c96215a..eb831f9 100644 --- a/src/User/resources/i18n/es/usuario.php +++ b/src/User/resources/i18n/es/usuario.php @@ -17,11 +17,9 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ - 'Required "key" cannot be empty.' => 'El atributo "key" es obligatorio.', - 'Required "secret" cannot be empty.' => 'El atributo "secret" es obligatorio.', - 'The "recaptcha" component must be configured.' => 'El component "recaptcha" debe estar configurado.', - 'The verification code is incorrect.' => 'El código de verificación es incorrecto.', - '{0} cannot be blank.' => '{0} no puede estar vacío.', + 'Are you sure you wish to send a password recovery email to this user?' => 'Estás seguro de querer enviar un email de recuperación de contraseña a este usuario?', + 'Send password recovery email' => 'Enviar email de recuperación de contraseña', + 'Unable to send recovery message to the user' => 'Ha sido imposible enviar el email de recuperación de contraseña', '(not set)' => '(sin establecer)', 'A confirmation message has been sent to your new email address' => 'Se ha enviado un mensaje de confirmación a tu nueva dirección de correo electrónico', 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => 'Un mensaje ha sido enviado a tu dirección de correo electrónico. Contiene un vínculo de confirmación que tienes que seguir para completar el registro.', @@ -152,6 +150,8 @@ return [ 'Registration time' => 'Hora de registro', 'Remember me next time' => 'Recuérdame la próxima vez', 'Request new confirmation message' => 'Solicita nuevo mensaje de confirmación', + 'Required "key" cannot be empty.' => 'El atributo "key" es obligatorio.', + 'Required "secret" cannot be empty.' => 'El atributo "secret" es obligatorio.', 'Reset your password' => 'Restablece contraseña', 'Role "{0}" not found. Creating it.' => 'Rol "{0}" no encontrado. Creándolo.', 'Roles' => 'Roles', @@ -170,7 +170,9 @@ return [ 'Switch identities is disabled.' => 'Personificación de usuarios deshabilitada.', 'Thank you for signing up on {0}' => 'Gracias por registrate en {0}', 'Thank you, registration is now complete.' => 'Gracias, el registro ha sido completado.', + 'The "recaptcha" component must be configured.' => 'El component "recaptcha" debe estar configurado.', 'The confirmation link is invalid or expired. Please try requesting a new one.' => 'El enlace de confirmación no es válido o ha caducado. Por favor, intenta a solicitar uno nuevo.', + 'The verification code is incorrect.' => 'El código de verificación es incorrecto.', 'There is neither role nor permission with name "{0}"' => 'No existe rol ni permiso con el nombre "{0}"', 'This account has already been connected to another user' => 'Esta cuenta ya está conectada con otro usuario', 'This email address has already been taken' => 'Esta cuenta de correo electrónico ya está siendo utilizada', @@ -239,4 +241,5 @@ return [ 'Your email address has been changed' => 'Tu cuenta de correo electrónico ha sido cambiada', 'Your profile has been updated' => 'Tu perfil ha sido actualizado', '{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, MMMM dd, YYYY HH:mm}', + '{0} cannot be blank.' => '{0} no puede estar vacío.', ]; diff --git a/src/User/resources/i18n/fa-IR/usuario.php b/src/User/resources/i18n/fa-IR/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/fa-IR/usuario.php +++ b/src/User/resources/i18n/fa-IR/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/fi/usuario.php b/src/User/resources/i18n/fi/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/fi/usuario.php +++ b/src/User/resources/i18n/fi/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/fr/usuario.php b/src/User/resources/i18n/fr/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/fr/usuario.php +++ b/src/User/resources/i18n/fr/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/hr/usuario.php b/src/User/resources/i18n/hr/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/hr/usuario.php +++ b/src/User/resources/i18n/hr/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/hu/usuario.php b/src/User/resources/i18n/hu/usuario.php index 70331bc..9db8843 100644 --- a/src/User/resources/i18n/hu/usuario.php +++ b/src/User/resources/i18n/hu/usuario.php @@ -18,6 +18,7 @@ */ return [ 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '', 'Cancel' => '', @@ -33,6 +34,7 @@ return [ 'Required "secret" cannot be empty.' => '', 'Role "{0}" not found. Creating it.' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'The "recaptcha" component must be configured.' => '', 'The verification code is incorrect.' => '', 'This will disable two-factor auth. Are you sure?' => '', @@ -44,6 +46,7 @@ return [ 'Two-factor authorization has been disabled.' => '', 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', + 'Unable to send recovery message to the user' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/it/usuario.php b/src/User/resources/i18n/it/usuario.php index 4cacb3a..3fa947f 100644 --- a/src/User/resources/i18n/it/usuario.php +++ b/src/User/resources/i18n/it/usuario.php @@ -18,6 +18,7 @@ */ return [ 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '', 'Cancel' => '', @@ -33,6 +34,7 @@ return [ 'Required "secret" cannot be empty.' => '', 'Role "{0}" not found. Creating it.' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'The "recaptcha" component must be configured.' => '', 'The verification code is incorrect.' => '', 'This will disable two-factor auth. Are you sure?' => '', @@ -44,6 +46,7 @@ return [ 'Two-factor authorization has been disabled.' => '', 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', + 'Unable to send recovery message to the user' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/kk/usuario.php b/src/User/resources/i18n/kk/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/kk/usuario.php +++ b/src/User/resources/i18n/kk/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/lt/usuario.php b/src/User/resources/i18n/lt/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/lt/usuario.php +++ b/src/User/resources/i18n/lt/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/nl/usuario.php b/src/User/resources/i18n/nl/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/nl/usuario.php +++ b/src/User/resources/i18n/nl/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/pl/usuario.php b/src/User/resources/i18n/pl/usuario.php index 5f503f5..0da67e2 100644 --- a/src/User/resources/i18n/pl/usuario.php +++ b/src/User/resources/i18n/pl/usuario.php @@ -17,12 +17,15 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => '', 'Required "key" cannot be empty.' => '', 'Required "secret" cannot be empty.' => '', 'Role "{0}" not found. Creating it.' => '', + 'Send password recovery email' => '', 'The "recaptcha" component must be configured.' => '', 'The verification code is incorrect.' => '', + 'Unable to send recovery message to the user' => '', '{0} cannot be blank.' => '', '(not set)' => '(nie podano)', 'A confirmation message has been sent to your new email address' => 'Potwierdzenie zostało wysłane na Twój nowy adres email', diff --git a/src/User/resources/i18n/pt-BR/usuario.php b/src/User/resources/i18n/pt-BR/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/pt-BR/usuario.php +++ b/src/User/resources/i18n/pt-BR/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/pt-PT/usuario.php b/src/User/resources/i18n/pt-PT/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/pt-PT/usuario.php +++ b/src/User/resources/i18n/pt-PT/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/ro/usuario.php b/src/User/resources/i18n/ro/usuario.php index 2ca4ae3..ed4b198 100644 --- a/src/User/resources/i18n/ro/usuario.php +++ b/src/User/resources/i18n/ro/usuario.php @@ -18,6 +18,7 @@ */ return [ 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '', 'Cancel' => '', @@ -33,6 +34,7 @@ return [ 'Required "secret" cannot be empty.' => '', 'Role "{0}" not found. Creating it.' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'The "recaptcha" component must be configured.' => '', 'The verification code is incorrect.' => '', 'This will disable two-factor auth. Are you sure?' => '', @@ -44,6 +46,7 @@ return [ 'Two-factor authorization has been disabled.' => '', 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', + 'Unable to send recovery message to the user' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/ru/usuario.php b/src/User/resources/i18n/ru/usuario.php index ae3e0fe..6152337 100644 --- a/src/User/resources/i18n/ru/usuario.php +++ b/src/User/resources/i18n/ru/usuario.php @@ -18,6 +18,7 @@ */ return [ 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => '', 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '', 'Cancel' => '', @@ -33,6 +34,7 @@ return [ 'Required "secret" cannot be empty.' => '', 'Role "{0}" not found. Creating it.' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'The "recaptcha" component must be configured.' => '', 'The verification code is incorrect.' => '', 'This will disable two-factor auth. Are you sure?' => '', @@ -44,6 +46,7 @@ return [ 'Two-factor authorization has been disabled.' => '', 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', + 'Unable to send recovery message to the user' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/th/usuario.php b/src/User/resources/i18n/th/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/th/usuario.php +++ b/src/User/resources/i18n/th/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/tr_TR/usuario.php b/src/User/resources/i18n/tr_TR/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/tr_TR/usuario.php +++ b/src/User/resources/i18n/tr_TR/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/uk/usuario.php b/src/User/resources/i18n/uk/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/uk/usuario.php +++ b/src/User/resources/i18n/uk/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/vi/usuario.php b/src/User/resources/i18n/vi/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/vi/usuario.php +++ b/src/User/resources/i18n/vi/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/i18n/zh-CN/usuario.php b/src/User/resources/i18n/zh-CN/usuario.php index 8a18a4e..09cc45d 100644 --- a/src/User/resources/i18n/zh-CN/usuario.php +++ b/src/User/resources/i18n/zh-CN/usuario.php @@ -35,6 +35,7 @@ return [ 'Are you sure you want to delete this user?' => '', 'Are you sure you want to switch to this user for the rest of this Session?' => '', 'Are you sure you want to unblock this user?' => '', + 'Are you sure you wish to send a password recovery email to this user?' => '', 'Are you sure? Deleted user can not be restored' => '', 'Are you sure? There is no going back' => '', 'Assignments' => '', @@ -161,6 +162,7 @@ return [ 'Rules' => '', 'Save' => '', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', + 'Send password recovery email' => '', 'Sign in' => '', 'Sign up' => '', 'Something went wrong' => '', @@ -192,6 +194,7 @@ return [ 'Unable to disable two-factor authorization.' => '', 'Unable to remove authorization item.' => '', 'Unable to send confirmation link' => '', + 'Unable to send recovery message to the user' => '', 'Unable to update authorization item.' => '', 'Unable to update authorization rule.' => '', 'Unable to update block status.' => '', diff --git a/src/User/resources/views/admin/index.php b/src/User/resources/views/admin/index.php index 97cee7c..cf2bf3c 100644 --- a/src/User/resources/views/admin/index.php +++ b/src/User/resources/views/admin/index.php @@ -121,7 +121,7 @@ $module = Yii::$app->getModule('user'); ], [ 'class' => 'yii\grid\ActionColumn', - 'template' => '{switch} {update} {delete}', + 'template' => '{switch} {reset} {update} {delete}', 'buttons' => [ 'switch' => function ($url, $model) use ($module) { if ($model->id != Yii::$app->user->id && $module->enableSwitchIdentities) { @@ -139,6 +139,24 @@ $module = Yii::$app->getModule('user'); ); } + return null; + }, + 'reset' => function ($url, $model) use ($module) { + if(!$module->allowPasswordRecovery && $module->allowAdminPasswordRecovery) { + return Html::a( + '', + ['/user/admin/password-reset', 'id' => $model->id], + [ + 'title' => Yii::t('usuario', 'Send password recovery email'), + 'data-confirm' => Yii::t( + 'usuario', + 'Are you sure you wish to send a password recovery email to this user?' + ), + 'data-method' => 'POST', + ] + ); + } + return null; } ] From 7451ffc1d14e7e9b7a6b8544cb64f977acc48f83 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 15 Oct 2017 23:02:08 +0200 Subject: [PATCH 003/108] re #23 cs fixer --- .php_cs.dist | 1 + src/User/Controller/AdminController.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.php_cs.dist b/.php_cs.dist index cf0a9f1..a9d6959 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -15,6 +15,7 @@ $finder = PhpCsFixer\Finder::create() 'temp', 'tests', 'vendor', + 'src/User/resources' ]) ->in(__DIR__); diff --git a/src/User/Controller/AdminController.php b/src/User/Controller/AdminController.php index 83d74fb..81c71b6 100644 --- a/src/User/Controller/AdminController.php +++ b/src/User/Controller/AdminController.php @@ -45,10 +45,10 @@ class AdminController extends Controller /** * AdminController constructor. * - * @param string $id - * @param Module $module + * @param string $id + * @param Module $module * @param UserQuery $userQuery - * @param array $config + * @param array $config */ public function __construct($id, Module $module, UserQuery $userQuery, array $config = []) { From 18ea0c664a00e220cb0666d960085418fbf43ca7 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 15 Oct 2017 23:08:49 +0200 Subject: [PATCH 004/108] re #85 add eseperio to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdb3774..f432a9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## 1.0.14 - Work in progress +- Fix #85: External links should open in a new tab|window (eseperio) - Enh #23: Provide administrator with an option to reset user password (tonydspaniard) - Enh #55: Provide google recaptcha mechanism (tonydspaniard) - Fix #20: Allow the assignment of a role on user creation via console (tonydspaniard) From 3feae01a17630bd76a31036e38c3c61b9543b665 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Wed, 18 Oct 2017 18:15:15 +0530 Subject: [PATCH 005/108] Enhancements to Mailer exception handling fixes #79 --- CHANGELOG.md | 2 + src/User/Controller/AdminController.php | 3 +- .../Controller/RegistrationController.php | 12 +--- src/User/Event/MailEvent.php | 67 +++++++++++++++++++ src/User/Factory/MailFactory.php | 24 +++++-- src/User/Service/MailService.php | 26 +++++-- src/User/Service/PasswordRecoveryService.php | 5 +- .../Service/ResendConfirmationService.php | 6 +- src/User/Service/UserCreateService.php | 20 ++++-- src/User/Service/UserRegisterService.php | 20 ++++-- src/User/Traits/MailAwareTrait.php | 53 +++++++++++++++ src/User/resources/i18n/ca/usuario.php | 4 ++ src/User/resources/i18n/da/usuario.php | 4 ++ src/User/resources/i18n/de-DU/usuario.php | 4 ++ src/User/resources/i18n/de/usuario.php | 4 ++ src/User/resources/i18n/es/usuario.php | 10 ++- src/User/resources/i18n/fa-IR/usuario.php | 4 ++ src/User/resources/i18n/fi/usuario.php | 4 ++ src/User/resources/i18n/fr/usuario.php | 4 ++ src/User/resources/i18n/hr/usuario.php | 4 ++ src/User/resources/i18n/hu/usuario.php | 4 ++ src/User/resources/i18n/it/usuario.php | 4 ++ src/User/resources/i18n/kk/usuario.php | 4 ++ src/User/resources/i18n/lt/usuario.php | 4 ++ src/User/resources/i18n/nl/usuario.php | 4 ++ src/User/resources/i18n/pl/usuario.php | 4 ++ src/User/resources/i18n/pt-BR/usuario.php | 4 ++ src/User/resources/i18n/pt-PT/usuario.php | 4 ++ src/User/resources/i18n/ro/usuario.php | 4 ++ src/User/resources/i18n/ru/usuario.php | 4 ++ src/User/resources/i18n/th/usuario.php | 4 ++ src/User/resources/i18n/tr_TR/usuario.php | 4 ++ src/User/resources/i18n/uk/usuario.php | 4 ++ src/User/resources/i18n/vi/usuario.php | 4 ++ src/User/resources/i18n/zh-CN/usuario.php | 4 ++ 35 files changed, 302 insertions(+), 38 deletions(-) create mode 100644 src/User/Event/MailEvent.php create mode 100644 src/User/Traits/MailAwareTrait.php diff --git a/CHANGELOG.md b/CHANGELOG.md index f432a9f..d789487 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # CHANGELOG ## 1.0.14 - Work in progress + +- Enh #79: Enhancements to Mailer exception handling and events (kartik-v) - Fix #85: External links should open in a new tab|window (eseperio) - Enh #23: Provide administrator with an option to reset user password (tonydspaniard) - Enh #55: Provide google recaptcha mechanism (tonydspaniard) diff --git a/src/User/Controller/AdminController.php b/src/User/Controller/AdminController.php index 81c71b6..00ab267 100644 --- a/src/User/Controller/AdminController.php +++ b/src/User/Controller/AdminController.php @@ -138,8 +138,9 @@ class AdminController extends Controller if ($this->make(UserCreateService::class, [$user, $mailService])->run()) { Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User has been created')); $this->trigger(UserEvent::EVENT_AFTER_CREATE, $event); - return $this->redirect(['update', 'id' => $user->id]); + } else { + Yii::$app->session->setFlash( 'danger', Yii::t('usuario', 'User account could not be created.')); } } diff --git a/src/User/Controller/RegistrationController.php b/src/User/Controller/RegistrationController.php index 53899ef..b9501b0 100644 --- a/src/User/Controller/RegistrationController.php +++ b/src/User/Controller/RegistrationController.php @@ -114,7 +114,6 @@ class RegistrationController extends Controller ) ); $this->trigger(FormEvent::EVENT_AFTER_REGISTER, $event); - return $this->render( '/shared/message', [ @@ -122,16 +121,11 @@ class RegistrationController extends Controller 'module' => $this->module, ] ); + } else { + Yii::$app->session->setFlash( 'danger', Yii::t('usuario', 'User could not be registered.')); } } - - return $this->render( - 'register', - [ - 'model' => $form, - 'module' => $this->module, - ] - ); + return $this->render('register', ['model' => $form, 'module' => $this->module]); } public function actionConnect($code) diff --git a/src/User/Event/MailEvent.php b/src/User/Event/MailEvent.php new file mode 100644 index 0000000..75bce1a --- /dev/null +++ b/src/User/Event/MailEvent.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Da\User\Event; + +use Da\User\Model\User; +use Da\User\Service\MailService; +use yii\base\Event; + +/** + * Mailer event to trap and handle mail exceptions for user model actions + * + * @author Kartik Visweswaran + */ +class MailEvent extends Event +{ + const TYPE_WELCOME = 'welcome'; + const TYPE_RECOVERY = 'recovery'; + const TYPE_CONFIRM = 'confirm'; + const TYPE_RECONFIRM = 'reconfirm'; + + const EVENT_BEFORE_SEND_MAIL = 'beforeSendMail'; + const EVENT_AFTER_SEND_MAIL = 'afterSendMail'; + + protected $type; + protected $user; + protected $mailService; + protected $exception; + + public function __construct($type, User $user, MailService $mailService, $exception, $config = []) + { + $this->type = $type; + $this->user = $user; + $this->mailService = $mailService; + $this->exception = $exception; + + parent::__construct($config); + } + + public function getType() + { + return $this->type; + } + + public function getUser() + { + return $this->user; + } + + public function getMailService() + { + return $this->mailService; + } + + public function getException() + { + return $this->mailService; + } +} diff --git a/src/User/Factory/MailFactory.php b/src/User/Factory/MailFactory.php index 2fef8b7..aea6550 100644 --- a/src/User/Factory/MailFactory.php +++ b/src/User/Factory/MailFactory.php @@ -11,12 +11,19 @@ namespace Da\User\Factory; +use Da\User\Event\MailEvent; use Da\User\Model\Token; use Da\User\Model\User; use Da\User\Module; use Da\User\Service\MailService; use Yii; +/** + * Class MailFactory + * + * @package Da\User\Factory + * @modified 2017-10-18 by Kartik Visweswaran + */ class MailFactory { /** @@ -39,7 +46,7 @@ class MailFactory 'showPassword' => $showPassword, ]; - return static::makeMailerService($from, $to, $subject, 'welcome', $params); + return static::makeMailerService(MailEvent::TYPE_WELCOME, $from, $to, $subject, 'welcome', $params); } /** @@ -60,7 +67,7 @@ class MailFactory 'token' => $token, ]; - return static::makeMailerService($from, $to, $subject, 'recovery', $params); + return static::makeMailerService(MailEvent::TYPE_RECOVERY, $from, $to, $subject, 'recovery', $params); } /** @@ -81,7 +88,7 @@ class MailFactory 'token' => $token, ]; - return static::makeMailerService($from, $to, $subject, 'recovery', $params); + return static::makeMailerService(MailEvent::TYPE_CONFIRM, $from, $to, $subject, 'recovery', $params); } /** @@ -105,12 +112,13 @@ class MailFactory 'token' => $token, ]; - return static::makeMailerService($from, $to, $subject, 'recovery', $params); + return static::makeMailerService(MailEvent::TYPE_RECONFIRM, $from, $to, $subject, 'recovery', $params); } /** * Builds a MailerService. * + * @param string $type * @param string $from * @param string $to * @param string $subject @@ -119,8 +127,12 @@ class MailFactory * * @return MailService */ - public static function makeMailerService($from, $to, $subject, $view, array $params = []) + public static function makeMailerService($type, $from, $to, $subject, $view, $params = []) { - return Yii::$container->get(MailService::class, [$from, $to, $subject, $view, $params, Yii::$app->getMailer()]); + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return Yii::$container->get( + MailService::class, + [$type, $from, $to, $subject, $view, $params, Yii::$app->getMailer()] + ); } } diff --git a/src/User/Service/MailService.php b/src/User/Service/MailService.php index a3c2414..81e9b9c 100644 --- a/src/User/Service/MailService.php +++ b/src/User/Service/MailService.php @@ -20,6 +20,7 @@ class MailService implements ServiceInterface { protected $viewPath = '@Da/User/resources/views/mail'; + protected $type; protected $from; protected $to; protected $subject; @@ -30,15 +31,17 @@ class MailService implements ServiceInterface /** * MailService constructor. * - * @param string $from - * @param string $to - * @param string $subject - * @param string $view - * @param array $params - * @param BaseMailer|MailerInterface $mailer + * @param string $type the mailer type + * @param string $from from email account + * @param string $to to email account + * @param string $subject the email subject + * @param string $view the view to render mail + * @param array $params view parameters + * @param BaseMailer|MailerInterface $mailer mailer interface */ - public function __construct($from, $to, $subject, $view, array $params, MailerInterface $mailer) + public function __construct($type, $from, $to, $subject, $view, array $params, MailerInterface $mailer) { + $this->type = $type; $this->from = $from; $this->to = $to; $this->subject = $subject; @@ -62,6 +65,15 @@ class MailService implements ServiceInterface return $this; } + /** + * gets mailer type + * @return string + */ + public function getType() + { + return $this->type; + } + /** * @return bool */ diff --git a/src/User/Service/PasswordRecoveryService.php b/src/User/Service/PasswordRecoveryService.php index ec0733b..08e7239 100644 --- a/src/User/Service/PasswordRecoveryService.php +++ b/src/User/Service/PasswordRecoveryService.php @@ -16,12 +16,15 @@ use Da\User\Factory\TokenFactory; use Da\User\Model\Token; use Da\User\Model\User; use Da\User\Query\UserQuery; +use Da\User\Traits\MailAwareTrait; use Exception; use Yii; use yii\log\Logger; class PasswordRecoveryService implements ServiceInterface { + use MailAwareTrait; + protected $query; protected $email; @@ -51,7 +54,7 @@ class PasswordRecoveryService implements ServiceInterface $this->mailService->setViewParam('user', $user); $this->mailService->setViewParam('token', $token); - if (!$this->mailService->run()) { + if (!$this->sendMail($user)) { return false; } diff --git a/src/User/Service/ResendConfirmationService.php b/src/User/Service/ResendConfirmationService.php index 119d495..e70618a 100644 --- a/src/User/Service/ResendConfirmationService.php +++ b/src/User/Service/ResendConfirmationService.php @@ -14,10 +14,13 @@ namespace Da\User\Service; use Da\User\Contracts\ServiceInterface; use Da\User\Factory\TokenFactory; use Da\User\Model\User; +use Da\User\Traits\MailAwareTrait; use yii\log\Logger; class ResendConfirmationService implements ServiceInterface { + use MailAwareTrait; + protected $model; protected $mailService; protected $logger; @@ -34,8 +37,7 @@ class ResendConfirmationService implements ServiceInterface if ($this->model && !$this->model->getIsConfirmed()) { $token = TokenFactory::makeConfirmationToken($this->model->id); $this->mailService->setViewParam('token', $token); - - return $this->mailService->run(); + return $this->sendMail($this->model); } return false; diff --git a/src/User/Service/UserCreateService.php b/src/User/Service/UserCreateService.php index 0cab543..9769362 100644 --- a/src/User/Service/UserCreateService.php +++ b/src/User/Service/UserCreateService.php @@ -15,12 +15,16 @@ use Da\User\Contracts\ServiceInterface; use Da\User\Event\UserEvent; use Da\User\Helper\SecurityHelper; use Da\User\Model\User; +use Da\User\Traits\MailAwareTrait; use Exception; +use Yii; use yii\base\InvalidCallException; use yii\log\Logger; class UserCreateService implements ServiceInterface { + use MailAwareTrait; + protected $model; protected $securityHelper; protected $mailService; @@ -57,15 +61,23 @@ class UserCreateService implements ServiceInterface if (!$model->save()) { $transaction->rollBack(); - return false; } $model->trigger(UserEvent::EVENT_AFTER_CREATE); - - $this->mailService->run(); + if (!$this->sendMail($model)) { + Yii::$app->session->setFlash( + 'warning', + Yii::t( + 'usuario', + 'Error sending welcome message to "{email}". Please try again later.', + ['email' => $model->email] + ) + ); + $transaction->rollBack(); + return false; + } $transaction->commit(); - return true; } catch (Exception $e) { $transaction->rollBack(); diff --git a/src/User/Service/UserRegisterService.php b/src/User/Service/UserRegisterService.php index 9e79dda..b14d4a2 100644 --- a/src/User/Service/UserRegisterService.php +++ b/src/User/Service/UserRegisterService.php @@ -16,16 +16,17 @@ use Da\User\Event\UserEvent; use Da\User\Factory\TokenFactory; use Da\User\Helper\SecurityHelper; use Da\User\Model\User; -use Da\User\Traits\ContainerAwareTrait; +use Da\User\Traits\MailAwareTrait; use Da\User\Traits\ModuleAwareTrait; use Exception; use yii\base\InvalidCallException; use yii\log\Logger; +use Yii; class UserRegisterService implements ServiceInterface { use ModuleAwareTrait; - use ContainerAwareTrait; + use MailAwareTrait; protected $model; protected $securityHelper; @@ -61,7 +62,6 @@ class UserRegisterService implements ServiceInterface if (!$model->save()) { $transaction->rollBack(); - return false; } @@ -72,8 +72,18 @@ class UserRegisterService implements ServiceInterface if (isset($token)) { $this->mailService->setViewParam('token', $token); } - $this->mailService->run(); - + if (!$this->sendMail($model)) { + Yii::$app->session->setFlash( + 'warning', + Yii::t( + 'usuario', + 'Error sending registration message to "{email}". Please try again later.', + ['email' => $model->email] + ) + ); + $transaction->rollBack(); + return false; + } $model->trigger(UserEvent::EVENT_AFTER_REGISTER, $event); $transaction->commit(); diff --git a/src/User/Traits/MailAwareTrait.php b/src/User/Traits/MailAwareTrait.php new file mode 100644 index 0000000..93df57b --- /dev/null +++ b/src/User/Traits/MailAwareTrait.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Da\User\Traits; + +use Da\QrCode\Exception\InvalidConfigException; +use Da\User\Event\MailEvent; +use Da\User\Model\User; +use Da\User\Service\MailService; +use Exception; +use yii\log\Logger; + +/** + * @property MailService $mailService + * @property Logger $logger + * @author Kartik Visweswaran + */ +trait MailAwareTrait +{ + use ContainerAwareTrait; + + /** + * Sends a mailer + * + * @param User $user + * + * @return bool + */ + protected function sendMail(User $user) + { + $type = $this->mailService->getType(); + $event = $this->make(MailEvent::class, [$type, $user, $this->mailService, null]); + $user->trigger(MailEvent::EVENT_BEFORE_SEND_MAIL, $event); + try { + $this->mailService->run(); + } catch (Exception $e) { + $event = $this->make(MailEvent::class, [$type, $user, $this->mailService, $e]); + $this->logger->log($e->getMessage(), Logger::LEVEL_ERROR); + $user->trigger(MailEvent::EVENT_AFTER_SEND_MAIL, $event); + return false; + } + $user->trigger(MailEvent::EVENT_AFTER_SEND_MAIL, $event); + return true; + } +} diff --git a/src/User/resources/i18n/ca/usuario.php b/src/User/resources/i18n/ca/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/ca/usuario.php +++ b/src/User/resources/i18n/ca/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/da/usuario.php b/src/User/resources/i18n/da/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/da/usuario.php +++ b/src/User/resources/i18n/da/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/de-DU/usuario.php b/src/User/resources/i18n/de-DU/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/de-DU/usuario.php +++ b/src/User/resources/i18n/de-DU/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/de/usuario.php b/src/User/resources/i18n/de/usuario.php index 389702b..1f0155f 100644 --- a/src/User/resources/i18n/de/usuario.php +++ b/src/User/resources/i18n/de/usuario.php @@ -35,6 +35,8 @@ return [ 'Disable Two-Factor Auth' => '', 'Enable' => '', 'Enable Two-factor auth' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Impersonate this user' => '', 'Invalid two-factor code' => '', 'Last login' => '', @@ -67,6 +69,8 @@ return [ 'Unable to update authorization rule.' => '', 'Update rule' => '', 'Updated at' => '', + 'User account could not be created.' => '', + 'User could not be registered.' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/es/usuario.php b/src/User/resources/i18n/es/usuario.php index eb831f9..6f1b237 100644 --- a/src/User/resources/i18n/es/usuario.php +++ b/src/User/resources/i18n/es/usuario.php @@ -17,9 +17,10 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ - 'Are you sure you wish to send a password recovery email to this user?' => 'Estás seguro de querer enviar un email de recuperación de contraseña a este usuario?', - 'Send password recovery email' => 'Enviar email de recuperación de contraseña', - 'Unable to send recovery message to the user' => 'Ha sido imposible enviar el email de recuperación de contraseña', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', + 'User account could not be created.' => '', + 'User could not be registered.' => '', '(not set)' => '(sin establecer)', 'A confirmation message has been sent to your new email address' => 'Se ha enviado un mensaje de confirmación a tu nueva dirección de correo electrónico', 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => 'Un mensaje ha sido enviado a tu dirección de correo electrónico. Contiene un vínculo de confirmación que tienes que seguir para completar el registro.', @@ -38,6 +39,7 @@ return [ 'Are you sure you want to delete this user?' => '¿Estas seguro de querer eliminar este usuario?', 'Are you sure you want to switch to this user for the rest of this Session?' => 'Estás seguro que quieres intercambiarte por este usuario para el resto de esta sesión?', 'Are you sure you want to unblock this user?' => '¿Estas seguro de querer desbloquear este usuario?', + 'Are you sure you wish to send a password recovery email to this user?' => 'Estás seguro de querer enviar un email de recuperación de contraseña a este usuario?', 'Are you sure? Deleted user can not be restored' => '¿Estas seguro? Los usuarios eliminados no se pueden restaurar', 'Are you sure? There is no going back' => '¿Estás seguro? No se podrá volver atrás', 'Assignments' => 'Asignaciones', @@ -164,6 +166,7 @@ return [ 'Rules' => 'Reglas', 'Save' => 'Guardar', 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => 'Escanee el QrCode con la aplicación Google Authenticator, luego inserte su código temporal en el campo de texto y envíe.', + 'Send password recovery email' => 'Enviar email de recuperación de contraseña', 'Sign in' => 'Iniciar sesión', 'Sign up' => 'Registrarse', 'Something went wrong' => 'Algo salió mal', @@ -195,6 +198,7 @@ return [ 'Unable to disable two-factor authorization.' => 'Ha sido imposible inhabilitar al autenticación de dos factores.', 'Unable to remove authorization item.' => 'No se ha podido eliminar el elemento de autorización.', 'Unable to send confirmation link' => 'No se ha podido enviar el enlace de confirmación', + 'Unable to send recovery message to the user' => 'Ha sido imposible enviar el email de recuperación de contraseña', 'Unable to update authorization item.' => 'No se ha podido actualizar el elemento de autorización.', 'Unable to update authorization rule.' => 'Ha sido imposible actualizar la regla de autencicación.', 'Unable to update block status.' => 'No se ha podido actualizar el estado de bloqueo.', diff --git a/src/User/resources/i18n/fa-IR/usuario.php b/src/User/resources/i18n/fa-IR/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/fa-IR/usuario.php +++ b/src/User/resources/i18n/fa-IR/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/fi/usuario.php b/src/User/resources/i18n/fi/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/fi/usuario.php +++ b/src/User/resources/i18n/fi/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/fr/usuario.php b/src/User/resources/i18n/fr/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/fr/usuario.php +++ b/src/User/resources/i18n/fr/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/hr/usuario.php b/src/User/resources/i18n/hr/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/hr/usuario.php +++ b/src/User/resources/i18n/hr/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/hu/usuario.php b/src/User/resources/i18n/hu/usuario.php index 9db8843..0f1d9cd 100644 --- a/src/User/resources/i18n/hu/usuario.php +++ b/src/User/resources/i18n/hu/usuario.php @@ -27,6 +27,8 @@ return [ 'Disable Two-Factor Auth' => '', 'Enable' => '', 'Enable Two-factor auth' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Invalid two-factor code' => '', 'Last login' => '', 'Never' => '', @@ -47,6 +49,8 @@ return [ 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', 'Unable to send recovery message to the user' => '', + 'User account could not be created.' => '', + 'User could not be registered.' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/it/usuario.php b/src/User/resources/i18n/it/usuario.php index 3fa947f..cfad813 100644 --- a/src/User/resources/i18n/it/usuario.php +++ b/src/User/resources/i18n/it/usuario.php @@ -27,6 +27,8 @@ return [ 'Disable Two-Factor Auth' => '', 'Enable' => '', 'Enable Two-factor auth' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Invalid two-factor code' => '', 'Last login' => '', 'Never' => '', @@ -47,6 +49,8 @@ return [ 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', 'Unable to send recovery message to the user' => '', + 'User account could not be created.' => '', + 'User could not be registered.' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/kk/usuario.php b/src/User/resources/i18n/kk/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/kk/usuario.php +++ b/src/User/resources/i18n/kk/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/lt/usuario.php b/src/User/resources/i18n/lt/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/lt/usuario.php +++ b/src/User/resources/i18n/lt/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/nl/usuario.php b/src/User/resources/i18n/nl/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/nl/usuario.php +++ b/src/User/resources/i18n/nl/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/pl/usuario.php b/src/User/resources/i18n/pl/usuario.php index 0da67e2..933b49b 100644 --- a/src/User/resources/i18n/pl/usuario.php +++ b/src/User/resources/i18n/pl/usuario.php @@ -19,6 +19,8 @@ return [ 'Are you sure you wish to send a password recovery email to this user?' => '', 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Required "key" cannot be empty.' => '', 'Required "secret" cannot be empty.' => '', 'Role "{0}" not found. Creating it.' => '', @@ -26,6 +28,8 @@ return [ 'The "recaptcha" component must be configured.' => '', 'The verification code is incorrect.' => '', 'Unable to send recovery message to the user' => '', + 'User account could not be created.' => '', + 'User could not be registered.' => '', '{0} cannot be blank.' => '', '(not set)' => '(nie podano)', 'A confirmation message has been sent to your new email address' => 'Potwierdzenie zostało wysłane na Twój nowy adres email', diff --git a/src/User/resources/i18n/pt-BR/usuario.php b/src/User/resources/i18n/pt-BR/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/pt-BR/usuario.php +++ b/src/User/resources/i18n/pt-BR/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/pt-PT/usuario.php b/src/User/resources/i18n/pt-PT/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/pt-PT/usuario.php +++ b/src/User/resources/i18n/pt-PT/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/ro/usuario.php b/src/User/resources/i18n/ro/usuario.php index ed4b198..f8b45e4 100644 --- a/src/User/resources/i18n/ro/usuario.php +++ b/src/User/resources/i18n/ro/usuario.php @@ -27,6 +27,8 @@ return [ 'Disable Two-Factor Auth' => '', 'Enable' => '', 'Enable Two-factor auth' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Invalid two-factor code' => '', 'Last login' => '', 'Never' => '', @@ -47,6 +49,8 @@ return [ 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', 'Unable to send recovery message to the user' => '', + 'User account could not be created.' => '', + 'User could not be registered.' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/ru/usuario.php b/src/User/resources/i18n/ru/usuario.php index 6152337..076dc77 100644 --- a/src/User/resources/i18n/ru/usuario.php +++ b/src/User/resources/i18n/ru/usuario.php @@ -27,6 +27,8 @@ return [ 'Disable Two-Factor Auth' => '', 'Enable' => '', 'Enable Two-factor auth' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Invalid two-factor code' => '', 'Last login' => '', 'Never' => '', @@ -47,6 +49,8 @@ return [ 'Two-factor code' => '', 'Unable to disable two-factor authorization.' => '', 'Unable to send recovery message to the user' => '', + 'User account could not be created.' => '', + 'User could not be registered.' => '', 'User not found.' => '', 'Verification failed. Please, enter new code.' => '', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', diff --git a/src/User/resources/i18n/th/usuario.php b/src/User/resources/i18n/th/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/th/usuario.php +++ b/src/User/resources/i18n/th/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/tr_TR/usuario.php b/src/User/resources/i18n/tr_TR/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/tr_TR/usuario.php +++ b/src/User/resources/i18n/tr_TR/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/uk/usuario.php b/src/User/resources/i18n/uk/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/uk/usuario.php +++ b/src/User/resources/i18n/uk/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/vi/usuario.php b/src/User/resources/i18n/vi/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/vi/usuario.php +++ b/src/User/resources/i18n/vi/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', diff --git a/src/User/resources/i18n/zh-CN/usuario.php b/src/User/resources/i18n/zh-CN/usuario.php index 09cc45d..2284ace 100644 --- a/src/User/resources/i18n/zh-CN/usuario.php +++ b/src/User/resources/i18n/zh-CN/usuario.php @@ -94,6 +94,8 @@ return [ 'Error occurred while changing password' => '', 'Error occurred while confirming user' => '', 'Error occurred while deleting user' => '', + 'Error sending registration message to "{email}". Please try again later.' => '', + 'Error sending welcome message to "{email}". Please try again later.' => '', 'Finish' => '', 'Forgot password?' => '', 'Gravatar email' => '', @@ -207,7 +209,9 @@ return [ 'Update rule' => '', 'Update user account' => '', 'Updated at' => '', + 'User account could not be created.' => '', 'User block status has been updated.' => '', + 'User could not be registered.' => '', 'User has been confirmed' => '', 'User has been created' => '', 'User has been deleted' => '', From dcebde5f76837c8372c7d487d2dc8e5dd545e8ec Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Wed, 18 Oct 2017 18:24:58 +0530 Subject: [PATCH 006/108] Remove unnecessary blank space --- src/User/Controller/RegistrationController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/User/Controller/RegistrationController.php b/src/User/Controller/RegistrationController.php index b9501b0..595db3d 100644 --- a/src/User/Controller/RegistrationController.php +++ b/src/User/Controller/RegistrationController.php @@ -122,7 +122,7 @@ class RegistrationController extends Controller ] ); } else { - Yii::$app->session->setFlash( 'danger', Yii::t('usuario', 'User could not be registered.')); + Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User could not be registered.')); } } return $this->render('register', ['model' => $form, 'module' => $this->module]); From 84dffec897ae07e9f837f612b4b7e83c2a988da4 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Wed, 18 Oct 2017 18:26:51 +0530 Subject: [PATCH 007/108] Remove unnecessary class use --- src/User/Traits/MailAwareTrait.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/User/Traits/MailAwareTrait.php b/src/User/Traits/MailAwareTrait.php index 93df57b..38d3693 100644 --- a/src/User/Traits/MailAwareTrait.php +++ b/src/User/Traits/MailAwareTrait.php @@ -11,7 +11,6 @@ namespace Da\User\Traits; -use Da\QrCode\Exception\InvalidConfigException; use Da\User\Event\MailEvent; use Da\User\Model\User; use Da\User\Service\MailService; From f4c7eb657220ffe551b134786c9db8c98725ea1a Mon Sep 17 00:00:00 2001 From: Ekaterina Date: Wed, 18 Oct 2017 17:09:22 +0300 Subject: [PATCH 008/108] Update usuario.php --- src/User/resources/i18n/ru/usuario.php | 133 ++++++++++++------------- 1 file changed, 66 insertions(+), 67 deletions(-) diff --git a/src/User/resources/i18n/ru/usuario.php b/src/User/resources/i18n/ru/usuario.php index 6152337..670cced 100644 --- a/src/User/resources/i18n/ru/usuario.php +++ b/src/User/resources/i18n/ru/usuario.php @@ -9,7 +9,7 @@ * Each array element represents the translation (value) of a message (key). * If the value is empty, the message is considered as not translated. * Messages that no longer need translation will have their translations - * enclosed between a pair of '@@' marks. + * enclosed between a pair of '' marks. * * Message string can be used with plural forms format. Check i18n section * of the guide for details. @@ -17,53 +17,52 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ - 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', - 'Are you sure you wish to send a password recovery email to this user?' => '', - 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => '', - 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '', - 'Cancel' => '', - 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => '', - 'Close' => '', - 'Disable Two-Factor Auth' => '', - 'Enable' => '', - 'Enable Two-factor auth' => '', - 'Invalid two-factor code' => '', - 'Last login' => '', - 'Never' => '', - 'Required "key" cannot be empty.' => '', - 'Required "secret" cannot be empty.' => '', - 'Role "{0}" not found. Creating it.' => '', - 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', - 'Send password recovery email' => '', - 'The "recaptcha" component must be configured.' => '', - 'The verification code is incorrect.' => '', - 'This will disable two-factor auth. Are you sure?' => '', - 'Two Factor Authentication' => '', - 'Two factor successfully enabled.' => '', - 'Two-Factor Authentication' => '', - 'Two-factor auth protects you against stolen credentials' => '', - 'Two-factor authentication code' => '', - 'Two-factor authorization has been disabled.' => '', - 'Two-factor code' => '', - 'Unable to disable two-factor authorization.' => '', - 'Unable to send recovery message to the user' => '', - 'User not found.' => '', - 'Verification failed. Please, enter new code.' => '', - 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', - 'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request.' => '', - '{0} cannot be blank.' => '', - 'A message has been sent to your email address. ' => '@@Сообщение было отправлено на вашу электронную почту@@', - 'Awesome, almost there. ' => '@@Замечательно, почти готово!@@', - 'Class "{0}" does not exist' => '@@Класс "{0}" не найден@@', - 'Registration ip' => '@@IP при регистрации@@', - 'Rule class can not be instantiated' => '@@Класс правила не может быть создан@@', - 'Rule class must extend "yii\\rbac\\Rule"' => '@@Класс правила должен наследоваться от "yii\\rbac\\Rule"@@', - 'We couldn\'t re-send the mail to confirm your address. ' => '@@Мы не можем повторно отправить письмо для подтверждения вашего адреса электронной почты.@@', - 'We have sent confirmation links to both old and new email addresses. ' => '@@Мы отправили письма на ваш старый и новый почтовые ящики. Вы должны перейти по обеим, чтобы завершить процесс смены адреса.@@', + 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => 'На вашу электронную почту было отправлено сообщение со ссылкой подтверждения регистрации.', + 'Are you sure you wish to send a password recovery email to this user?' => 'Вы уверены, что хотите отправить письмо с восстановлением пароля на почту этому пользователю?', + 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => 'Замечательно, почти готово. Вам осталось перейти по ссылке подтверждения, отправленной на новый адрес вашей электронной почты.', + 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => 'Замечательно, почти готово. Вам осталось перейти по ссылке подтверждения, отправленной на старый адрес вашей электронной почты.', + 'Cancel' => 'Отменить', + 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => 'В вашем консольном приложении не настроен AuthManager, поэтому не удалось назначить роль "{0}".', + 'Close' => 'Закрыть', + 'Disable Two-Factor Auth' => 'Отключить двухфакторную авторизацию', + 'Enable' => 'Включить', + 'Enable Two-factor auth' => 'Включить двухфакторную авторизацию', + 'Invalid two-factor code' => 'Неверный код двухфакторной авторизации', + 'Last login' => 'Последний вход', + 'Never' => 'Никогда', + 'Required "key" cannot be empty.' => 'Поле "key" не может быть пустым.', + 'Required "secret" cannot be empty.' => 'Поле "secret" не может быть пустым.', + 'Role "{0}" not found. Creating it.' => 'Роль "{0}" не найдена. Создаём её.', + 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => 'Просканируйте QR-код приложением Google Authenticator App, затем вставьте временный код в поле и отправьте.', + 'Send password recovery email' => 'Отправить письмо с восстановлением пароля', + 'The "recaptcha" component must be configured.' => 'Необходимо настроить компонент "recaptcha"', + 'The verification code is incorrect.' => 'Неправильный код подтверждения.', + 'This will disable two-factor auth. Are you sure?' => 'Вы уверены, что хотите отключить двухфакторную авторизацию?', + 'Two Factor Authentication' => 'Двухфакторная авторизация', + 'Two factor successfully enabled.' => 'Включена двухфакторная авторизация.', + 'Two-Factor Authentication' => 'Двухфакторная авторизация', + 'Two-factor auth protects you against stolen credentials' => 'Двухфакторная авторизация предотвращает кражу ваших данных для входа.', + 'Two-factor authentication code' => 'Код двухфакторной авторизации', + 'Two-factor authorization has been disabled.' => 'Двухфакторная авторизация отключена.', + 'Two-factor code' => 'Код двухфакторной авторизации', + 'Unable to disable two-factor authorization.' => 'Не удалось отключить двухфакторную авторизацию.', + 'Unable to send recovery message to the user' => 'Не удалось отправить пользователю письмо восстановления', + 'User not found.' => 'Пользователь не найден.', + 'Verification failed. Please, enter new code.' => 'Проверка не удалась. Пожауйста, введите новый код', + 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => 'Не удалось повторно отправить письмо для подтверждения вашего адреса электронной почты. Пожалуйста, проверьте, что ввели корректный адрес или что он ещё не был подтверждён.', + 'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request.' => 'Мы отправили письма на ваш старый и новый адреса. Вы должны перейти по обеим ссылкам, чтобы завершить процесс смены адреса.', + '{0} cannot be blank.' => '{0} не может быть пустым.', + 'A message has been sent to your email address. ' => 'Сообщение было отправлено на вашу электронную почту', + 'Awesome, almost there. ' => 'Замечательно, почти готово!', + 'Class "{0}" does not exist' => 'Класс "{0}" не найден', + 'Registration ip' => 'IP при регистрации', + 'Rule class can not be instantiated' => 'Класс правила не может быть создан', + 'Rule class must extend "yii\\rbac\\Rule"' => 'Класс правила должен наследоваться от "yii\\rbac\\Rule"', + 'We couldn\'t re-send the mail to confirm your address. ' => 'Не удалось повторно отправить письмо для подтверждения вашего адреса электронной почты.', '(not set)' => '(не задано)', - 'A confirmation message has been sent to your new email address' => 'На указаный email было отправлено письмо с дальнейшими инструкциями', + 'A confirmation message has been sent to your new email address' => 'На указанный адрес было отправлено письмо с дальнейшими инструкциями', 'A new confirmation link has been sent' => 'Ссылка для подтверждения была отправлена вам на почту', - 'A password will be generated automatically if not provided' => 'Если Вы не укажите пароль, он будет сгенерирован автоматически', + 'A password will be generated automatically if not provided' => 'Если Вы не укажете пароль, он будет сгенерирован автоматически', 'Account' => 'Аккаунт', 'Account confirmation' => 'Подтверждение аккаунта', 'Account details' => 'Детали аккаунта', @@ -77,7 +76,7 @@ return [ 'Are you sure you want to delete this user?' => 'Вы действительно хотите удалить этого пользователя?', 'Are you sure you want to switch to this user for the rest of this Session?' => 'Вы уверены, что хотите переключиться на этого пользователя до окончании текущей сессии?', 'Are you sure you want to unblock this user?' => 'Вы действительно хотите разблокировать этого пользователя?', - 'Are you sure? Deleted user can not be restored' => 'Вы уверены? Удаленный аккаунт не может быть восстановлен', + 'Are you sure? Deleted user can not be restored' => 'Вы уверены? Удалённый аккаунт невозможно будет восстановить', 'Are you sure? There is no going back' => 'Вы уверены? Это действие невозможно отменить', 'Assignments' => 'Назначения', 'Assignments have been updated' => 'Назначения были обновлены', @@ -92,7 +91,7 @@ return [ 'Bio' => 'О себе', 'Block' => 'Блокировка', 'Block status' => 'Статус блокировки', - 'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => 'Заблокирован {0, date, MMMM dd, YYYY HH:mm}', + 'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => 'Заблокирован {0, date, d MMMM YYYY в HH:mm}', 'Change your avatar at Gravatar.com' => 'Изменить аватар на сайте Gravatar.com', 'Children' => 'Дочерние элементы', 'Class' => 'Класс', @@ -104,7 +103,7 @@ return [ 'Confirmation status' => 'Статус активации', 'Confirmation time' => 'Время активации', 'Confirmed' => 'Активирован', - 'Confirmed at {0, date, MMMM dd, YYYY HH:mm}' => 'Активирован {0, date, MMMM dd, YYYY HH:mm}', + 'Confirmed at {0, date, MMMM dd, YYYY HH:mm}' => 'Активирован {0, date, d MMMM YYYY в HH:mm}', 'Connect' => 'Подключить', 'Continue' => 'Продолжить', 'Create' => 'Создать', @@ -115,7 +114,7 @@ return [ 'Created at' => 'Дата создания', 'Credentials will be sent to the user by email' => 'Данные для входа будут отправлены пользователю на почту', 'Current password' => 'Текущий пароль', - 'Current password is not valid' => 'Текущий пароль введен неправильно', + 'Current password is not valid' => 'Текущий пароль введён неправильно', 'Delete' => 'Удалить', 'Delete account' => 'Удалить аккаунт', 'Description' => 'Описание', @@ -132,12 +131,12 @@ return [ 'Gravatar email' => 'Email для Gravatar', 'Hello' => 'Здравствуйте', 'If you already registered, sign in and connect this account on settings page' => 'Если вы уже зарегистрированы, войдите и подключите аккаунт в настройках', - 'If you cannot click the link, please try pasting the text into your browser' => 'Если вы не можете нажать на ссылку, скопируйте ее и вставьте в адресную строку вашего браузера', + 'If you cannot click the link, please try pasting the text into your browser' => 'Если вы не можете нажать на ссылку, скопируйте её и вставьте в адресную строку вашего браузера', 'If you did not make this request you can ignore this email' => 'Если вы получили это сообщение по ошибке, просто проигнорируйте или удалите его', 'Impersonate this user' => 'Переключиться на данного пользователя', - 'In order to complete your registration, please click the link below' => 'Чтобы активировать ваш аккаунт, пожалуйста, нажмите на ссылку ниже', + 'In order to complete your registration, please click the link below' => 'Чтобы активировать свой аккаунт, пожалуйста, нажмите на ссылку ниже', 'In order to complete your request, please click the link below' => 'Чтобы завершить запрос, нажмите на ссылку ниже', - 'In order to finish your registration, we need you to enter following fields' => 'Чтобы закончить регистрацию, вы должны заполнить следующие поля', + 'In order to finish your registration, we need you to enter following fields' => 'Чтобы закончить регистрацию, заполните следующие поля', 'Information' => 'Информация', 'Invalid login or password' => 'Неправильный логин или пароль', 'Invalid or expired link' => 'Ссылка неправильна или устарела', @@ -164,19 +163,19 @@ return [ 'Password has been changed' => 'Пароль был изменён', 'Permissions' => 'Разрешения', 'Please be certain' => 'Пожалуйста, будьте осторожны', - 'Please click the link below to complete your password reset' => 'Пожалуйста, нажмита на ссылку ниже, чтобы завершить процедуру сброса пароля', + 'Please click the link below to complete your password reset' => 'Пожалуйста, нажмите на ссылку ниже, чтобы завершить процедуру сброса пароля', 'Please fix following errors:' => 'Исправьте следующие ошибки:', 'Profile' => 'Профиль', 'Profile details' => 'Профиль', - 'Profile details have been updated' => 'Профиль пользователя был обновлен', + 'Profile details have been updated' => 'Профиль пользователя был обновлён', 'Profile settings' => 'Настройки профиля', 'Recover your password' => 'Восстановить пароль', - 'Recovery link is invalid or expired. Please try requesting a new one.' => 'Ссылка для смены пароля неправильна или устарела. Пожалуйста, попробуйте запросить новую ссылку.', + 'Recovery link is invalid or expired. Please try requesting a new one.' => 'Ссылка для смены пароля неправильна или устарела. Вы можете запросить новую.', 'Recovery message sent' => 'Письмо для сброса пароля было отправлено', 'Registration IP' => 'IP при регистрации', 'Registration on this website is disabled' => 'Регистрация на сайте отключена', 'Registration time' => 'Время регистрации', - 'Remember me next time' => 'Запопомнить меня', + 'Remember me next time' => 'Запомнить меня', 'Request new confirmation message' => 'Запросить новое подтверждающее письмо', 'Reset your password' => 'Сбросить пароль', 'Roles' => 'Роли', @@ -195,13 +194,13 @@ return [ 'Thank you for signing up on {0}' => 'Спасибо за регистрацию на сайте {0}', 'Thank you, registration is now complete.' => 'Поздравляем, регистрация успешно завершена!', 'The confirmation link is invalid or expired. Please try requesting a new one.' => 'Ссылка для активации аккаунта неправильна или устарела. Вы можете запросить новую.', - 'There is neither role nor permission with name "{0}"' => 'Нет ни роли ни разрешения с именем "{0}"', - 'This account has already been connected to another user' => 'Этот аккаунт уже был привязан к другой учетной записи', + 'There is neither role nor permission with name "{0}"' => 'Нет ни роли, ни разрешения с именем "{0}"', + 'This account has already been connected to another user' => 'Этот аккаунт уже привязан к другой учетной записи', 'This email address has already been taken' => 'Email уже используется', 'This username has already been taken' => 'Это имя пользователя уже используется', 'Time zone' => 'Часовой пояс', 'Time zone is not valid' => 'Некорректный часовой пояс', - 'Unable to confirm user. Please, try again.' => 'Не удалось активировать пользователя. Пожалуйста, попробуйте еще раз.', + 'Unable to confirm user. Please, try again.' => 'Не удалось активировать пользователя. Пожалуйста, попробуйте ещё раз.', 'Unable to create an account.' => 'Не удалось создать аккаунт.', 'Unable to create authorization item.' => 'Не удалось создать элемент авторизации', 'Unable to create new authorization rule.' => 'Не удалось создать правило авторизации.', @@ -220,10 +219,10 @@ return [ 'Update rule' => 'Изменить правило', 'Update user account' => 'Обновить аккаунт пользователя', 'Updated at' => 'Дата редактирования', - 'User block status has been updated.' => 'Статус блокировки пользователя обновлен.', + 'User block status has been updated.' => 'Статус блокировки пользователя обновлён.', 'User has been confirmed' => 'Пользователь был активирован', 'User has been created' => 'Пользователь был создан', - 'User has been deleted' => 'Пользователь был удален', + 'User has been deleted' => 'Пользователь был удалён', 'User is not found' => 'Пользователь не найден', 'Username' => 'Имя пользователя', 'Users' => 'Пользователи', @@ -238,16 +237,16 @@ return [ 'You can connect multiple accounts to be able to log in using them' => 'Вы можете подключить несколько аккаунтов, чтобы использовать их для входа', 'You cannot remove your own account' => 'Вы не можете удалить свой аккаунт', 'You need to confirm your email address' => 'Вам нужно подтвердить ваш адрес электронной почты', - 'Your account details have been updated' => 'Настройки аккаунта были изменен', + 'Your account details have been updated' => 'Настройки аккаунта были изменён', 'Your account has been blocked' => 'Ваш аккаунт заблокирован', 'Your account has been blocked.' => 'Ваш аккаунт заблокирован.', 'Your account has been completely deleted' => 'Ваш аккаунт был полностью удалён', - 'Your account has been connected' => 'Аккаунт был успешно подключен', + 'Your account has been connected' => 'Аккаунт был успешно подключён', 'Your account has been created' => 'Ваш аккаунт был создан', - 'Your account has been created and a message with further instructions has been sent to your email' => 'Ваш аккаунт был создан и сообщение с дальнейшими инструкциями отправлено на ваш email', + 'Your account has been created and a message with further instructions has been sent to your email' => 'Ваш аккаунт успешно создан, сообщение с дальнейшими инструкциями отправлено на ваш адрес электронной почты', 'Your account on {0} has been created' => 'Ваш аккаунт на сайте "{0}" был успешно создан', 'Your confirmation token is invalid or expired' => 'Ваша ссылка устарела или является ошибочной', - 'Your email address has been changed' => 'Ваш email был успешно изменен', + 'Your email address has been changed' => 'Ваш email был успешно изменён', 'Your profile has been updated' => 'Настройки профиля были успешно сохранены', - '{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, MMMM dd, YYYY HH:mm}', + '{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, d MMMM YYYY в HH:mm}', ]; From 54dfd28f0225ef48109b00696c8d75cadf5e4155 Mon Sep 17 00:00:00 2001 From: Ekaterina Date: Wed, 18 Oct 2017 17:10:30 +0300 Subject: [PATCH 009/108] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f432a9f..53c7cf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Enh #61: Updated Russian translation (faenir) - Enh #70: Allow permission-permission parent-child relationship (Philosoft) - Enh #82: Updated Polish translation (bizley) +- Enh #83: Updated Russian translation (Katenkka) ## 1.0.13 - August 12, 2017 - Fix #49: Fix wrong call of method make() for set attributes (MKiselev) From 7632285744d2cc31061dc0db6226941b09d85d36 Mon Sep 17 00:00:00 2001 From: Ekaterina Date: Wed, 18 Oct 2017 17:16:42 +0300 Subject: [PATCH 010/108] Update usuario.php --- src/User/resources/i18n/ru/usuario.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/User/resources/i18n/ru/usuario.php b/src/User/resources/i18n/ru/usuario.php index 670cced..dd9c5f5 100644 --- a/src/User/resources/i18n/ru/usuario.php +++ b/src/User/resources/i18n/ru/usuario.php @@ -9,7 +9,7 @@ * Each array element represents the translation (value) of a message (key). * If the value is empty, the message is considered as not translated. * Messages that no longer need translation will have their translations - * enclosed between a pair of '' marks. + * enclosed between a pair of '@@' marks. * * Message string can be used with plural forms format. Check i18n section * of the guide for details. @@ -52,12 +52,14 @@ return [ 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => 'Не удалось повторно отправить письмо для подтверждения вашего адреса электронной почты. Пожалуйста, проверьте, что ввели корректный адрес или что он ещё не был подтверждён.', 'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request.' => 'Мы отправили письма на ваш старый и новый адреса. Вы должны перейти по обеим ссылкам, чтобы завершить процесс смены адреса.', '{0} cannot be blank.' => '{0} не может быть пустым.', - 'A message has been sent to your email address. ' => 'Сообщение было отправлено на вашу электронную почту', - 'Awesome, almost there. ' => 'Замечательно, почти готово!', - 'Class "{0}" does not exist' => 'Класс "{0}" не найден', - 'Registration ip' => 'IP при регистрации', - 'Rule class can not be instantiated' => 'Класс правила не может быть создан', - 'Rule class must extend "yii\\rbac\\Rule"' => 'Класс правила должен наследоваться от "yii\\rbac\\Rule"', + 'A message has been sent to your email address. ' => '@@Сообщение было отправлено на вашу электронную почту@@', + 'Awesome, almost there. ' => '@@Замечательно, почти готово!@@', + 'Class "{0}" does not exist' => '@@Класс "{0}" не найден@@', + 'Registration ip' => '@@IP при регистрации@@', + 'Rule class can not be instantiated' => '@@Класс правила не может быть создан@@', + 'Rule class must extend "yii\\rbac\\Rule"' => '@@Класс правила должен наследоваться от "yii\\rbac\\Rule"@@', + 'We couldn\'t re-send the mail to confirm your address. ' => '@@Мы не можем повторно отправить письмо для подтверждения вашего адреса электронной почты.@@', + 'We have sent confirmation links to both old and new email addresses. ' => '@@Мы отправили письма на ваш старый и новый почтовые ящики. Вы должны перейти по обеим, чтобы завершить процесс смены адреса.@@', 'We couldn\'t re-send the mail to confirm your address. ' => 'Не удалось повторно отправить письмо для подтверждения вашего адреса электронной почты.', '(not set)' => '(не задано)', 'A confirmation message has been sent to your new email address' => 'На указанный адрес было отправлено письмо с дальнейшими инструкциями', From 1fae0f055d1434cc6c505fdcb516bf96d2cc4409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BA=D0=B0=D1=82=D0=B5=D1=80=D0=B8=D0=BD=D0=B0?= Date: Wed, 18 Oct 2017 18:13:08 +0300 Subject: [PATCH 011/108] Fixes after merge with #88 --- src/User/resources/i18n/ru/usuario.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/User/resources/i18n/ru/usuario.php b/src/User/resources/i18n/ru/usuario.php index a714a31..d7fe376 100644 --- a/src/User/resources/i18n/ru/usuario.php +++ b/src/User/resources/i18n/ru/usuario.php @@ -27,8 +27,8 @@ return [ 'Disable Two-Factor Auth' => 'Отключить двухфакторную авторизацию', 'Enable' => 'Включить', 'Enable Two-factor auth' => 'Включить двухфакторную авторизацию', - 'Error sending registration message to "{email}". Please try again later.' => '', - 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error sending registration message to "{email}". Please try again later.' => 'Ошибка при отправке письма о регистрации на "{email}". Пожалуйста, попробуйте позже.', + 'Error sending welcome message to "{email}". Please try again later.' => 'Ошибка при отправке приветственного письма на "{email}". Пожалуйста, попробуйте позже.', 'Invalid two-factor code' => 'Неверный код двухфакторной авторизации', 'Last login' => 'Последний вход', 'Never' => 'Никогда', @@ -49,8 +49,8 @@ return [ 'Two-factor code' => 'Код двухфакторной авторизации', 'Unable to disable two-factor authorization.' => 'Не удалось отключить двухфакторную авторизацию.', 'Unable to send recovery message to the user' => 'Не удалось отправить пользователю письмо восстановления', - 'User account could not be created.' => '', - 'User could not be registered.' => '', + 'User account could not be created.' => 'Не удалось создать аккаунт для пользователя.', + 'User could not be registered.' => 'Не удалось зарегистрировать пользователя.', 'User not found.' => 'Пользователь не найден.', 'Verification failed. Please, enter new code.' => 'Проверка не удалась. Пожауйста, введите новый код', 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => 'Не удалось повторно отправить письмо для подтверждения вашего адреса электронной почты. Пожалуйста, проверьте, что ввели корректный адрес или что он ещё не был подтверждён.', @@ -64,7 +64,6 @@ return [ 'Rule class must extend "yii\\rbac\\Rule"' => '@@Класс правила должен наследоваться от "yii\\rbac\\Rule"@@', 'We couldn\'t re-send the mail to confirm your address. ' => '@@Мы не можем повторно отправить письмо для подтверждения вашего адреса электронной почты.@@', 'We have sent confirmation links to both old and new email addresses. ' => '@@Мы отправили письма на ваш старый и новый почтовые ящики. Вы должны перейти по обеим, чтобы завершить процесс смены адреса.@@', - 'We couldn\'t re-send the mail to confirm your address. ' => 'Не удалось повторно отправить письмо для подтверждения вашего адреса электронной почты.', '(not set)' => '(не задано)', 'A confirmation message has been sent to your new email address' => 'На указанный адрес было отправлено письмо с дальнейшими инструкциями', 'A new confirmation link has been sent' => 'Ссылка для подтверждения была отправлена вам на почту', From 556d662e2b28122a3a065f865fc5a54828af92b5 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Thu, 19 Oct 2017 10:29:27 +0530 Subject: [PATCH 012/108] Fix #91: Add Documentation for Mail events --- CHANGELOG.md | 1 + docs/events/mail-events.md | 101 ++++++++++++++++++++++++ src/User/Controller/AdminController.php | 2 +- 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 docs/events/mail-events.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d09491..f52b255 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.0.14 - Work in progress +- Enh #91: Documentation for Mail events (kartik-v) - Enh #79: Enhancements to Mailer exception handling and events (kartik-v) - Fix #85: External links should open in a new tab|window (eseperio) - Enh #23: Provide administrator with an option to reset user password (tonydspaniard) diff --git a/docs/events/mail-events.md b/docs/events/mail-events.md new file mode 100644 index 0000000..b6efa03 --- /dev/null +++ b/docs/events/mail-events.md @@ -0,0 +1,101 @@ +Mail Events +=========== + +The following is the list of the mail events and where they happen: + +On Models +--------- + +- **User** + - `MailEvent::EVENT_BEFORE_SEND_MAIL`: triggered before a mail is sent + - `MailEvent::EVENT_AFTER_SEND_MAIL`: triggered after a mail is sent + +Mail Event Getter Methods +------------------------- + +Each of the events above would receive the following properties via getter methods: + +1. `getType()`: _string_, returns the type of mailer sent. The following mailer types will be returned: + - `MailEvent::TYPE_WELCOME` or `'welcome'`: when a welcome mailer is sent on user creation or registration signup. + - `MailEvent::TYPE_RECOVERY` or `'recovery'`: when a password reset / recovery mailer is sent. + - `MailEvent::TYPE_CONFIRM` or `'confirm'`: when an account confirmation mailer is sent. + - `MailEvent::TYPE_RECONFIRM` or `'reconfirm'`: when an account confirmation mailer is requested for resending. +- `getUser()`: _Da\User\Model\User_, returns the current user model +- `getMailService()`: _Da\User\Service\MailService_, returns the mail service instance +- `getException()`: _Exception_, returns the exception object instance in case a mailer sending exception is received. + This will be `NULL` if no exception is received. It will also always be `NULL` for `MailEvent::EVENT_BEFORE_SEND_MAIL` + and any exception received will only be trapped via `MailEvent::EVENT_AFTER_SEND_MAIL`. + +How to Work With Mail Events +---------------------------- + +All these events receive an instance of `Da\User\Event\MailEvent`. The Event receives an instance of a `Da\Model\User` +class and the other getter method properties as listed earlier, that you could use for whatever logic you wish to implement. + +The recommended way to make use of events is by creating a new file in your config folder (i.e. `events.php`), configure +there all your events and then include that file on your +[`entry script`](http://www.yiiframework.com/doc-2.0/guide-structure-entry-scripts.html). + +Here is an example of setting an event for the `User` model: + +```php +getUser(); + $type = $event->getType(); + $mailService = $event->getMailService(); + + // ... your logic here +} + +// AFTER MAIL IS SENT: This will happen at the model's level +Event::on(User::class, MailEvent::EVENT_AFTER_SEND_MAIL, function (MailEvent $event) { + + $user = $event->getUser(); + $type = $event->getType(); + $mailService = $event->getMailService(); + $exception = $event->getException(); // fetches exception received if any + + // ... your logic here based on exception received for example + if ($exception !== null) { + // do something + } +} +``` + +Now, the only thing I need to do is adding the `events.php` file to your entry script (i.e. `index.php`). The following +is taken from the Yii 2 Advanced Application Template: + +```php +run(); + +``` + +© [2amigos](http://www.2amigos.us/) 2013-2017 diff --git a/src/User/Controller/AdminController.php b/src/User/Controller/AdminController.php index 00ab267..f0ddf23 100644 --- a/src/User/Controller/AdminController.php +++ b/src/User/Controller/AdminController.php @@ -140,7 +140,7 @@ class AdminController extends Controller $this->trigger(UserEvent::EVENT_AFTER_CREATE, $event); return $this->redirect(['update', 'id' => $user->id]); } else { - Yii::$app->session->setFlash( 'danger', Yii::t('usuario', 'User account could not be created.')); + Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User account could not be created.')); } } From fb9cdc78d38d893ff7bd0185cc20e245c2d393a0 Mon Sep 17 00:00:00 2001 From: Kartik Visweswaran Date: Thu, 19 Oct 2017 10:35:22 +0530 Subject: [PATCH 013/108] Update docs index --- docs/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.md b/docs/index.md index 248f96f..a43f951 100644 --- a/docs/index.md +++ b/docs/index.md @@ -148,6 +148,7 @@ there all your events and then include that file on your [`entry script`](http://www.yiiframework.com/doc-2.0/guide-structure-entry-scripts.html). - [User Events](events/user-events.md) +- [Mail Events](events/mail-events.md) - [Form Events](events/form-events.md) - [Reset Password Events](events/reset-password-events.md) - [Social Network Authentication Events](events/social-network-auth-events.md) From 23406e03093647318abd906a948045a41e308b70 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 22 Oct 2017 21:38:11 +0200 Subject: [PATCH 014/108] Close #92 fix docs --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index a43f951..3547ea3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -77,7 +77,7 @@ return [ 'controllerMap' => [ 'migrate' => [ 'class' => \yii\console\controllers\MigrateController::class, - 'migrationPath => [ + 'migrationPath' => [ '@app/migrations', '@yii/rbac/migrations', // Just in case you forgot to run it on console (see next note) ], From d812a301ec1708db33fc64335e445a1fa96c8f36 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 22 Oct 2017 21:44:53 +0200 Subject: [PATCH 015/108] Close #87 fix docs --- CHANGELOG.md | 1 + docs/installation/advanced-application-template.md | 7 ++++++- docs/installation/yii2-application-template.md | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f52b255..a083e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Enh #70: Allow permission-permission parent-child relationship (Philosoft) - Enh #82: Updated Polish translation (bizley) - Enh #83: Updated Russian translation (Katenkka) +- Fix #87: Fix wrong documentation info (tonydspaniard) ## 1.0.13 - August 12, 2017 - Fix #49: Fix wrong call of method make() for set attributes (MKiselev) diff --git a/docs/installation/advanced-application-template.md b/docs/installation/advanced-application-template.md index fc70140..3586f75 100644 --- a/docs/installation/advanced-application-template.md +++ b/docs/installation/advanced-application-template.md @@ -57,7 +57,8 @@ which comes from the default installation of the Advanced Application Template. There are two ways to apply migrations of this extension, the first one: ```php -./yii migrate --migrationPath="@Da/User/Migration" +./yii migrate --migrationNamespaces=Da\\User\\Migration +./yii migrate --migrationPath=@yii/rbac/migrations ./yii migrate ``` @@ -75,6 +76,10 @@ return [ 'controllerMap' => [ 'migrate' => [ 'class' => \yii\console\controllers\MigrateController::class, + 'migrationPath' => [ + '@app/migrations', + '@yii/rbac/migrations', // Just in case you forgot to run it on console (see next note) + ], 'migrationNamespaces' => [ 'Da\User\Migration', ], diff --git a/docs/installation/yii2-application-template.md b/docs/installation/yii2-application-template.md index cbd1d6b..1b9a581 100644 --- a/docs/installation/yii2-application-template.md +++ b/docs/installation/yii2-application-template.md @@ -45,7 +45,8 @@ which comes from the default installation of the Advanced Application Template. There are two ways to apply migrations of this extension, the first one: ```php -./yii migrate --migrationPath="@Da/User/Migration" +./yii migrate --migrationNamespaces=Da\\User\\Migration +./yii migrate --migrationPath=@yii/rbac/migrations ./yii migrate ``` @@ -66,6 +67,10 @@ return [ 'migrationNamespaces' => [ 'Da\User\Migration', ], + 'migrationPath' => [ + '@app/migrations', + '@yii/rbac/migrations', + ], ], ], // ... From e0479f94fe2516c2ecbe7a0877184519b31517fb Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 22 Oct 2017 22:03:30 +0200 Subject: [PATCH 016/108] Close #86 fix view location path (thanks @Esperio) --- CHANGELOG.md | 1 + src/User/Widget/LoginWidget.php | 2 +- src/User/resources/views/widgets/login/{login.php => form.php} | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename src/User/resources/views/widgets/login/{login.php => form.php} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a083e60..94cfa3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Enh #82: Updated Polish translation (bizley) - Enh #83: Updated Russian translation (Katenkka) - Fix #87: Fix wrong documentation info (tonydspaniard) +- Fix #86: Fix view location bug (tonydspaniard) ## 1.0.13 - August 12, 2017 - Fix #49: Fix wrong call of method make() for set attributes (MKiselev) diff --git a/src/User/Widget/LoginWidget.php b/src/User/Widget/LoginWidget.php index 5b05288..f4d2a54 100644 --- a/src/User/Widget/LoginWidget.php +++ b/src/User/Widget/LoginWidget.php @@ -22,7 +22,7 @@ class LoginWidget extends Widget public function run() { return $this->render( - '/widgets/login', + '@Da/User/resources/views/widgets/login/form', [ 'model' => Yii::createObject(LoginForm::class), ] diff --git a/src/User/resources/views/widgets/login/login.php b/src/User/resources/views/widgets/login/form.php similarity index 100% rename from src/User/resources/views/widgets/login/login.php rename to src/User/resources/views/widgets/login/form.php From 4d8dbf58ac3b552c55ffe481bc708cf7e2f929b0 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 22 Oct 2017 22:09:46 +0200 Subject: [PATCH 017/108] set up version launch --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94cfa3b..9bf1ffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## 1.0.14 - Work in progress +## 1.1.0 - October 22, 2017 - Enh #91: Documentation for Mail events (kartik-v) - Enh #79: Enhancements to Mailer exception handling and events (kartik-v) From 24458bac9b947997ae36a3797900caf62beb7d9f Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Sun, 22 Oct 2017 22:12:39 +0200 Subject: [PATCH 018/108] add missing spanish translations from latest updates and update changelog --- CHANGELOG.md | 3 ++- src/User/resources/i18n/es/usuario.php | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bf1ffb..e2de39b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # CHANGELOG -## 1.1.0 - October 22, 2017 +## 1.1.1 - Work in progress +## 1.1.0 - October 22, 2017 - Enh #91: Documentation for Mail events (kartik-v) - Enh #79: Enhancements to Mailer exception handling and events (kartik-v) - Fix #85: External links should open in a new tab|window (eseperio) diff --git a/src/User/resources/i18n/es/usuario.php b/src/User/resources/i18n/es/usuario.php index 6f1b237..eb31f3d 100644 --- a/src/User/resources/i18n/es/usuario.php +++ b/src/User/resources/i18n/es/usuario.php @@ -17,10 +17,10 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ - 'Error sending registration message to "{email}". Please try again later.' => '', - 'Error sending welcome message to "{email}". Please try again later.' => '', - 'User account could not be created.' => '', - 'User could not be registered.' => '', + 'Error sending registration message to "{email}". Please try again later.' => 'Ha ocurrido un error enviando el mensaje de registro a "{email}". Por favor inténtalo de nuevo más tarde.', + 'Error sending welcome message to "{email}". Please try again later.' => 'Ha ocurrido un error al enviar el mensaje de bienvenida a "{email}". Por favor inténtalo de nuevo más tarde.', + 'User account could not be created.' => 'La cuenta de usuario no ha podido ser creada.', + 'User could not be registered.' => 'El usuario no ha podido ser registrado.', '(not set)' => '(sin establecer)', 'A confirmation message has been sent to your new email address' => 'Se ha enviado un mensaje de confirmación a tu nueva dirección de correo electrónico', 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => 'Un mensaje ha sido enviado a tu dirección de correo electrónico. Contiene un vínculo de confirmación que tienes que seguir para completar el registro.', From 1d1fc3c9449a44dd2a959d9382010e036955aeb0 Mon Sep 17 00:00:00 2001 From: jkmssoft Date: Wed, 25 Oct 2017 17:35:14 +0200 Subject: [PATCH 019/108] Add autofocus --- src/User/resources/views/registration/register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/User/resources/views/registration/register.php b/src/User/resources/views/registration/register.php index 1cc3577..d305270 100644 --- a/src/User/resources/views/registration/register.php +++ b/src/User/resources/views/registration/register.php @@ -37,7 +37,7 @@ $this->params['breadcrumbs'][] = $this->title; ] ); ?> - field($model, 'email') ?> + field($model, 'email')->textInput(['autofocus' => true]) ?> field($model, 'username') ?> From bf024c9fbbf4c8ee3234228e534be6934692105c Mon Sep 17 00:00:00 2001 From: jkmssoft Date: Wed, 25 Oct 2017 18:28:44 +0200 Subject: [PATCH 020/108] de translation --- src/User/resources/i18n/de/usuario.php | 120 ++++++++++++------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/src/User/resources/i18n/de/usuario.php b/src/User/resources/i18n/de/usuario.php index 1f0155f..a719215 100644 --- a/src/User/resources/i18n/de/usuario.php +++ b/src/User/resources/i18n/de/usuario.php @@ -17,65 +17,65 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ - 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', - 'Are you sure you want to switch to this user for the rest of this Session?' => '', - 'Are you sure you wish to send a password recovery email to this user?' => '', - 'Authentication rule class {0} can not be instantiated' => '', - 'Authorization rule has been added.' => '', - 'Authorization rule has been removed.' => '', - 'Authorization rule has been updated.' => '', - 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => '', - 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '', - 'Cancel' => '', - 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => '', - 'Class' => '', - 'Close' => '', - 'Create new rule' => '', - 'Created at' => '', - 'Disable Two-Factor Auth' => '', - 'Enable' => '', - 'Enable Two-factor auth' => '', - 'Error sending registration message to "{email}". Please try again later.' => '', - 'Error sending welcome message to "{email}". Please try again later.' => '', - 'Impersonate this user' => '', - 'Invalid two-factor code' => '', - 'Last login' => '', - 'Never' => '', - 'New rule' => '', - 'Required "key" cannot be empty.' => '', - 'Required "secret" cannot be empty.' => '', - 'Role "{0}" not found. Creating it.' => '', - 'Rule class must extend "yii\\rbac\\Rule".' => '', - 'Rule name {0} is already in use' => '', - 'Rule {0} does not exists' => '', - 'Rule {0} not found.' => '', - 'Rules' => '', - 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', - 'Send password recovery email' => '', - 'Switch identities is disabled.' => '', - 'The "recaptcha" component must be configured.' => '', - 'The verification code is incorrect.' => '', - 'This will disable two-factor auth. Are you sure?' => '', - 'Two Factor Authentication' => '', - 'Two factor successfully enabled.' => '', - 'Two-Factor Authentication' => '', - 'Two-factor auth protects you against stolen credentials' => '', - 'Two-factor authentication code' => '', - 'Two-factor authorization has been disabled.' => '', - 'Two-factor code' => '', - 'Unable to create new authorization rule.' => '', - 'Unable to disable two-factor authorization.' => '', - 'Unable to send recovery message to the user' => '', - 'Unable to update authorization rule.' => '', - 'Update rule' => '', - 'Updated at' => '', - 'User account could not be created.' => '', - 'User could not be registered.' => '', - 'User not found.' => '', - 'Verification failed. Please, enter new code.' => '', - 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', - 'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request.' => '', - '{0} cannot be blank.' => '', + 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => 'Eine Nachricht wurde an Ihre E-Mail-Adresse gesendet. Sie enthält einen Bestätigungslink den Sie klicken müssen um die Registrierung abzuschließen.', + 'Are you sure you want to switch to this user for the rest of this Session?' => 'Sind Sie sicher, dass Sie zu diesem Benutzer zu wechseln möchten für den Rest dieser Session?', + 'Are you sure you wish to send a password recovery email to this user?' => 'Sind Sie sicher, dass Sie eine Passwortwiederherstellungs-Mail an diesen Benutzer senden möchten?', + 'Authentication rule class {0} can not be instantiated' => 'Von der Authentifizierungsregel Klasse {0} kann keine Instanz erstellt werden', + 'Authorization rule has been added.' => 'Berechtigungsregel wurde hinzugefügt.', + 'Authorization rule has been removed.' => 'Berechtigungsregel wurde entfernt.', + 'Authorization rule has been updated.' => 'Berechtigungsregel wurde gespeichert.', + 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => 'Fast geschafft. Nun müssen Sie nur noch den Aktivierungslink besuchen, der an ihre neue E-Mail Adresse gesendet wurde.', + 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => 'Fast geschafft. Nun müssen Sie nur noch den Aktivierungslink besuchen, der an ihre alte E-Mail Adresse gesendet wurde.', + 'Cancel' => 'Abbrechen', + 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => 'Kann die Rolle "{0}" nicht zuordnen da der AuthManager in der Console Application nicht konfiguriert ist.', + 'Class' => 'Klasse', + 'Close' => 'schließen', + 'Create new rule' => 'Neue Regel erstellen', + 'Created at' => 'Erstellt am', + 'Disable Two-Factor Auth' => 'Zweifaktor-Authentifizierung deaktivieren', + 'Enable' => 'aktivieren', + 'Enable Two-factor auth' => 'Zweifaktor-Authentifizierung aktivieren', + 'Error sending registration message to "{email}". Please try again later.' => 'Fehler beim Senden der Registrierungsnachricht an "{email}". Bitte später noch einmal probieren.', + 'Error sending welcome message to "{email}". Please try again later.' => 'Fehler beim Senden der Willkommensnachricht an "{email}". Bitte später noch einmal probieren.', + 'Impersonate this user' => 'Wechsle zu diesem Benutzer', + 'Invalid two-factor code' => 'Ungültiger Zweifaktor Schlüssel', + 'Last login' => 'Letzter Login', + 'Never' => 'Nie', + 'New rule' => 'Neue Regel', + 'Required "key" cannot be empty.' => 'Erforderlicher "key" darf nicht leer sein.', + 'Required "secret" cannot be empty.' => 'Erforderliches "secret" darf nicht leer sein.', + 'Role "{0}" not found. Creating it.' => 'Rolle "{0}" nicht gefunden. Erstelle diese.', + 'Rule class must extend "yii\\rbac\\Rule".' => 'Regelklasse muss "yii\\rbac\\Rule" erweitern.', + 'Rule name {0} is already in use' => 'Regelname {0} bereits in Benutzung', + 'Rule {0} does not exists' => 'Regel {0} existiert nicht', + 'Rule {0} not found.' => 'Regel {0} nicht gefunden.', + 'Rules' => 'Regeln', + 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => 'Scanne den Qr-Code mit der Google Authenticator App, dann füge den temporären Schlüssel in das Feld und sende es ab.', + 'Send password recovery email' => 'Sende Mail zur Passwortwiederherstellung', + 'Switch identities is disabled.' => 'Identitäten wechseln ist deaktiviert.', + 'The "recaptcha" component must be configured.' => 'Die "recaptcha" Komponente muss konfiguriert werden.', + 'The verification code is incorrect.' => 'Der Verifizierungsschlüssel ist ungültig.', + 'This will disable two-factor auth. Are you sure?' => 'Dies wird die Zweifaktor-Authentifizierung deaktivieren. Sind Sie sicher?', + 'Two Factor Authentication' => 'Zweifaktor-Authentifizierung', + 'Two factor successfully enabled.' => 'Zweifaktor-Authentifizierung erfolgreich aktiviert.', + 'Two-Factor Authentication' => 'Zweifaktor-Authentifizierung', + 'Two-factor auth protects you against stolen credentials' => 'Zweifaktor-Authentifizierung schützt Sie vor gestohlenen Zugangsdaten', + 'Two-factor authentication code' => 'Zweifaktor-Authentifizierungsschlüssel', + 'Two-factor authorization has been disabled.' => 'Zweifaktor-Authentifizierung wurde deaktiviert.', + 'Two-factor code' => 'Zweifaktor-Schlüssel', + 'Unable to create new authorization rule.' => 'Unfähig eine neue Authentifizierungsregel zu erstellen.', + 'Unable to disable two-factor authorization.' => 'Unfähig die Zweifaktor-Authentifizierung zu deaktivieren.', + 'Unable to send recovery message to the user' => 'Unfähig die Wiederherstellungsnachricht an den Benutzer zu senden.', + 'Unable to update authorization rule.' => 'Unfähig die Berechtigungsregel zu speichern.', + 'Update rule' => 'Regel aktualisieren', + 'Updated at' => 'Aktualisiert am', + 'User account could not be created.' => 'Benutzerkonto konnte nicht erstellt werden.', + 'User could not be registered.' => 'Benutzer konnte nicht registriert werden.', + 'User not found.' => 'Benutzer nicht gefunden.', + 'Verification failed. Please, enter new code.' => 'Verifizierung fehlgeschlagen. Bitte einen neuen Schlüssel eingeben.', + 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => 'Wir konnten die Mail zur Bestätigung Ihrer Adresse nicht noch einmal senden. Bitte kontrollieren Sie ob die E-Mail-Adresse korrekt ist oder diese bereits bestätigt wurde.', + 'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request.' => 'Wir haben Ihnen Bestätigungslinks an die alte und neue E-Mail-Adresse geschickt. Sie müssen beide Links anklicken um die Anfrage fertigzustellen.', + '{0} cannot be blank.' => '{0} darf nicht leer sein.', 'A message has been sent to your email address. ' => '@@Eine Nachricht wurde an ihre E-Mail Adresse versandt@@', 'Awesome, almost there. ' => '@@Fast geschafft. @@', 'Class "{0}" does not exist' => '@@Klasse "{0}" existiert nicht@@', @@ -114,7 +114,7 @@ return [ 'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => 'Blockiert am {0, date, dd. MMMM YYYY, HH:mm}', 'Change your avatar at Gravatar.com' => 'Ändern Sie ihren Avatar auf Gravatar.com', 'Children' => 'Unterelemente', - 'Complete password reset on {0}' => 'Passwort-Wiederherstellung auf {0} fertig stellen', + 'Complete password reset on {0}' => 'Passwort-Wiederherstellung auf {0} fertigstellen', 'Confirm' => 'Bestätigen', 'Confirm account on {0}' => 'Konto auf {0} bestätigen', 'Confirm email change on {0}' => 'E-Mail Änderung auf {0} bestätigen', From 9a083ce6ab071a2a435a8fefa18e947583fba76e Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Thu, 26 Oct 2017 16:57:57 +0200 Subject: [PATCH 021/108] re #99 add credits for german translation --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2de39b..cc4c94e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## 1.1.1 - Work in progress +- Enh #99: Added German translation (jkmssoft) ## 1.1.0 - October 22, 2017 - Enh #91: Documentation for Mail events (kartik-v) From 34d415b1736dc95a06d50045601b1dc68cf712ea Mon Sep 17 00:00:00 2001 From: "Gustavo G. Andrade" Date: Thu, 26 Oct 2017 23:20:49 -0200 Subject: [PATCH 022/108] Added pt-BR translate --- src/User/resources/i18n/pt-BR/usuario.php | 474 +++++++++++----------- 1 file changed, 237 insertions(+), 237 deletions(-) diff --git a/src/User/resources/i18n/pt-BR/usuario.php b/src/User/resources/i18n/pt-BR/usuario.php index 2284ace..36c7e4f 100644 --- a/src/User/resources/i18n/pt-BR/usuario.php +++ b/src/User/resources/i18n/pt-BR/usuario.php @@ -17,241 +17,241 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ - '(not set)' => '', - 'A confirmation message has been sent to your new email address' => '', - 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => '', - 'A new confirmation link has been sent' => '', - 'A password will be generated automatically if not provided' => '', - 'Account' => '', - 'Account confirmation' => '', - 'Account details' => '', - 'Account details have been updated' => '', - 'Account settings' => '', - 'Already registered? Sign in!' => '', - 'An email has been sent with instructions for resetting your password' => '', - 'An error occurred processing your request' => '', - 'Are you sure you want to block this user?' => '', - 'Are you sure you want to confirm this user?' => '', - 'Are you sure you want to delete this user?' => '', - 'Are you sure you want to switch to this user for the rest of this Session?' => '', - 'Are you sure you want to unblock this user?' => '', - 'Are you sure you wish to send a password recovery email to this user?' => '', - 'Are you sure? Deleted user can not be restored' => '', - 'Are you sure? There is no going back' => '', - 'Assignments' => '', - 'Assignments have been updated' => '', - 'Auth item with such name already exists' => '', - 'Authentication rule class {0} can not be instantiated' => '', - 'Authorization item successfully created.' => '', - 'Authorization item successfully removed.' => '', - 'Authorization item successfully updated.' => '', - 'Authorization rule has been added.' => '', - 'Authorization rule has been removed.' => '', - 'Authorization rule has been updated.' => '', - 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => '', - 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '', - 'Bio' => '', - 'Block' => '', - 'Block status' => '', - 'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => '', - 'Cancel' => '', - 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => '', - 'Change your avatar at Gravatar.com' => '', - 'Children' => '', - 'Class' => '', - 'Close' => '', - 'Complete password reset on {0}' => '', - 'Confirm' => '', - 'Confirm account on {0}' => '', - 'Confirm email change on {0}' => '', - 'Confirmation' => '', - 'Confirmation status' => '', - 'Confirmation time' => '', - 'Confirmed' => '', - 'Confirmed at {0, date, MMMM dd, YYYY HH:mm}' => '', - 'Connect' => '', - 'Continue' => '', - 'Create' => '', - 'Create a user account' => '', - 'Create new permission' => '', - 'Create new role' => '', - 'Create new rule' => '', - 'Created at' => '', - 'Credentials will be sent to the user by email' => '', - 'Current password' => '', - 'Current password is not valid' => '', - 'Delete' => '', - 'Delete account' => '', - 'Description' => '', - 'Didn\'t receive confirmation message?' => '', - 'Disable Two-Factor Auth' => '', - 'Disconnect' => '', - 'Don\'t have an account? Sign up!' => '', - 'Email' => '', - 'Email (public)' => '', - 'Enable' => '', - 'Enable Two-factor auth' => '', - 'Error occurred while changing password' => '', - 'Error occurred while confirming user' => '', - 'Error occurred while deleting user' => '', - 'Error sending registration message to "{email}". Please try again later.' => '', - 'Error sending welcome message to "{email}". Please try again later.' => '', - 'Finish' => '', - 'Forgot password?' => '', - 'Gravatar email' => '', - 'Hello' => '', - 'If you already registered, sign in and connect this account on settings page' => '', - 'If you cannot click the link, please try pasting the text into your browser' => '', - 'If you did not make this request you can ignore this email' => '', - 'Impersonate this user' => '', - 'In order to complete your registration, please click the link below' => '', - 'In order to complete your request, please click the link below' => '', - 'In order to finish your registration, we need you to enter following fields' => '', - 'Information' => '', - 'Invalid login or password' => '', - 'Invalid or expired link' => '', - 'Invalid two-factor code' => '', - 'Invalid value' => '', - 'It will be deleted forever' => '', - 'Items' => '', - 'Joined on {0, date}' => '', - 'Last login' => '', - 'Location' => '', - 'Login' => '', - 'Logout' => '', - 'Manage users' => '', - 'Name' => '', - 'Networks' => '', - 'Never' => '', - 'New email' => '', - 'New password' => '', - 'New permission' => '', - 'New role' => '', - 'New rule' => '', - 'New user' => '', - 'Not blocked' => '', - 'Not found' => '', - 'Once you delete your account, there is no going back' => '', - 'Password' => '', - 'Password has been changed' => '', - 'Permissions' => '', - 'Please be certain' => '', - 'Please click the link below to complete your password reset' => '', - 'Please fix following errors:' => '', - 'Profile' => '', - 'Profile details' => '', - 'Profile details have been updated' => '', - 'Profile settings' => '', - 'Recover your password' => '', - 'Recovery link is invalid or expired. Please try requesting a new one.' => '', - 'Recovery message sent' => '', - 'Registration IP' => '', - 'Registration on this website is disabled' => '', - 'Registration time' => '', - 'Remember me next time' => '', - 'Request new confirmation message' => '', - 'Required "key" cannot be empty.' => '', - 'Required "secret" cannot be empty.' => '', - 'Reset your password' => '', - 'Role "{0}" not found. Creating it.' => '', - 'Roles' => '', - 'Rule' => '', - 'Rule class must extend "yii\\rbac\\Rule".' => '', - 'Rule name' => '', - 'Rule name {0} is already in use' => '', - 'Rule {0} does not exists' => '', - 'Rule {0} not found.' => '', - 'Rules' => '', - 'Save' => '', - 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => '', - 'Send password recovery email' => '', - 'Sign in' => '', - 'Sign up' => '', - 'Something went wrong' => '', - 'Switch identities is disabled.' => '', - 'Thank you for signing up on {0}' => '', - 'Thank you, registration is now complete.' => '', - 'The "recaptcha" component must be configured.' => '', - 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', - 'The verification code is incorrect.' => '', - 'There is neither role nor permission with name "{0}"' => '', - 'This account has already been connected to another user' => '', - 'This email address has already been taken' => '', - 'This username has already been taken' => '', - 'This will disable two-factor auth. Are you sure?' => '', - 'Time zone' => '', - 'Time zone is not valid' => '', - 'Two Factor Authentication' => '', - 'Two factor successfully enabled.' => '', - 'Two-Factor Authentication' => '', - 'Two-factor auth protects you against stolen credentials' => '', - 'Two-factor authentication code' => '', - 'Two-factor authorization has been disabled.' => '', - 'Two-factor code' => '', - 'Unable to confirm user. Please, try again.' => '', - 'Unable to create an account.' => '', - 'Unable to create authorization item.' => '', - 'Unable to create new authorization rule.' => '', - 'Unable to delete user. Please, try again later.' => '', - 'Unable to disable two-factor authorization.' => '', - 'Unable to remove authorization item.' => '', - 'Unable to send confirmation link' => '', - 'Unable to send recovery message to the user' => '', - 'Unable to update authorization item.' => '', - 'Unable to update authorization rule.' => '', - 'Unable to update block status.' => '', - 'Unblock' => '', - 'Unconfirmed' => '', - 'Update' => '', - 'Update assignments' => '', - 'Update permission' => '', - 'Update role' => '', - 'Update rule' => '', - 'Update user account' => '', - 'Updated at' => '', - 'User account could not be created.' => '', - 'User block status has been updated.' => '', - 'User could not be registered.' => '', - 'User has been confirmed' => '', - 'User has been created' => '', - 'User has been deleted' => '', - 'User is not found' => '', - 'User not found.' => '', - 'Username' => '', - 'Users' => '', - 'VKontakte' => '', - 'Verification failed. Please, enter new code.' => '', - 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => '', - 'We have generated a password for you' => '', - 'We have received a request to change the email address for your account on {0}' => '', - 'We have received a request to reset the password for your account on {0}' => '', - 'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request.' => '', - 'Website' => '', - 'Welcome to {0}' => '', - 'Yandex' => '', - 'You can assign multiple roles or permissions to user by using the form below' => '', - 'You can connect multiple accounts to be able to log in using them' => '', - 'You cannot remove your own account' => '', - 'You need to confirm your email address' => '', - 'Your account details have been updated' => '', - 'Your account has been blocked' => '', - 'Your account has been blocked.' => '', - 'Your account has been completely deleted' => '', - 'Your account has been connected' => '', - 'Your account has been created' => '', - 'Your account has been created and a message with further instructions has been sent to your email' => '', - 'Your account on {0} has been created' => '', - 'Your confirmation token is invalid or expired' => '', - 'Your email address has been changed' => '', - 'Your profile has been updated' => '', - '{0, date, MMMM dd, YYYY HH:mm}' => '', - '{0} cannot be blank.' => '', - 'A message has been sent to your email address. ' => '@@@@', - 'Awesome, almost there. ' => '@@@@', - 'Class "{0}" does not exist' => '@@@@', - 'Registration ip' => '@@@@', - 'Rule class can not be instantiated' => '@@@@', - 'Rule class must extend "yii\\rbac\\Rule"' => '@@@@', - 'We couldn\'t re-send the mail to confirm your address. ' => '@@@@', - 'We have sent confirmation links to both old and new email addresses. ' => '@@@@', + '(not set)' => '(não informado)', + 'A confirmation message has been sent to your new email address' => 'Uma mensagem de confirmação foi enviada para seu novo endereço de e-mail', + 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.' => 'Uma mensagem foi enviada para o seu endereço de e-mail. Ele contém um link de confirmação que você deve clicar para completar o registro.', + 'A new confirmation link has been sent' => 'Um novo link de confirmação foi enviado', + 'A password will be generated automatically if not provided' => 'Uma senha será gerada automaticamente se não for fornecida', + 'Account' => 'Conta', + 'Account confirmation' => 'Confirmação da conta', + 'Account details' => 'Detalhes da conta', + 'Account details have been updated' => 'Os detalhes da conta foram atualizados', + 'Account settings' => 'Configurações da conta', + 'Already registered? Sign in!' => 'Já registrado? Acesse!', + 'An email has been sent with instructions for resetting your password' => 'Um e-mail foi enviado com instruções para redefinir sua senha', + 'An error occurred processing your request' => 'Ocorreu um erro ao processar seu pedido', + 'Are you sure you want to block this user?' => 'Tem certeza de que deseja bloquear esse usuário?', + 'Are you sure you want to confirm this user?' => 'Tem certeza de que deseja confirmar esse usuário?', + 'Are you sure you want to delete this user?' => 'Tem certeza de que deseja excluir esse usuário?', + 'Are you sure you want to switch to this user for the rest of this Session?' => 'Tem certeza de que deseja mudar para este usuário para o resto desta Sessão?', + 'Are you sure you want to unblock this user?' => 'Tem certeza de que deseja desbloquear esse usuário?', + 'Are you sure you wish to send a password recovery email to this user?' => 'Tem certeza de que deseja enviar um email de recuperação de senha para este usuário?', + 'Are you sure? Deleted user can not be restored' => 'Você tem certeza? O usuário excluído não pode ser restaurado', + 'Are you sure? There is no going back' => 'Você tem certeza? Não há retorno', + 'Assignments' => 'Atribuições', + 'Assignments have been updated' => 'Atribuições atualizadas', + 'Auth item with such name already exists' => 'O item com esse nome já existe', + 'Authentication rule class {0} can not be instantiated' => 'A classe de regras de autenticação {0} não pode ser instanciada', + 'Authorization item successfully created.' => 'Item de autorização criado com sucesso.', + 'Authorization item successfully removed.' => 'Item de autorização removido com sucesso.', + 'Authorization item successfully updated.' => 'Item de autorização atualizado com sucesso.', + 'Authorization rule has been added.' => 'A regra de autorização foi adicionada.', + 'Authorization rule has been removed.' => 'A regra de autorização foi removida.', + 'Authorization rule has been updated.' => 'A regra de autorização foi atualizada.', + 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address.' => 'Incrível, quase lá. Agora você precisa clicar no link de confirmação enviado ao seu novo endereço de e-mail.', + 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => 'Incrível, quase lá. Agora você precisa clicar no link de confirmação enviado ao seu novo endereço de e-mail.', + 'Bio' => 'Bio', + 'Block' => 'Bloquear', + 'Block status' => 'Bloquear situação', + 'Blocked at {0, date, MMMM dd, YYYY HH:mm}' => 'Bloqueado em {0, date, MMMM dd, YYYY HH:mm}', + 'Cancel' => 'Cancelar', + 'Cannot assign role "{0}" as the AuthManager is not configured on your console application.' => 'Não é possível atribuir a função "{0}" como o AuthManager não está configurado no seu aplicativo de console.', + 'Change your avatar at Gravatar.com' => 'Mude seu avatar para Gravatar.com', + 'Children' => 'Crianças', + 'Class' => 'Classe', + 'Close' => 'Fechar', + 'Complete password reset on {0}' => 'Reinicialização completa da senha em {0}', + 'Confirm' => 'Confirmar', + 'Confirm account on {0}' => 'Confirme a conta em {0}', + 'Confirm email change on {0}' => 'Confirme alteração do e-mail em', + 'Confirmation' => 'Confirmação', + 'Confirmation status' => 'Status de confirmação', + 'Confirmation time' => 'Hora de confirmação', + 'Confirmed' => 'Confirmado', + 'Confirmed at {0, date, MMMM dd, YYYY HH:mm}' => 'Confirmado em {0, date, MMMM dd, YYYY HH:mm}', + 'Connect' => 'Conectado', + 'Continue' => 'Continuar', + 'Create' => 'Criar', + 'Create a user account' => 'Criar uma conta de usuário', + 'Create new permission' => 'Criar nova permissão', + 'Create new role' => 'Criar nova função', + 'Create new rule' => 'Criar nova regra', + 'Created at' => 'Criado em', + 'Credentials will be sent to the user by email' => 'As credenciais serão enviadas ao usuário por e-mail', + 'Current password' => 'Senha atual', + 'Current password is not valid' => 'Senha atual inválida', + 'Delete' => 'Excluir', + 'Delete account' => 'Excluir conta', + 'Description' => 'Descrição', + 'Didn\'t receive confirmation message?' => 'Não recebeu mensagem de confirmação?', + 'Disable Two-Factor Auth' => 'Desabilitar autenticação em dois fatores', + 'Disconnect' => 'Desconectar', + 'Don\'t have an account? Sign up!' => 'Não tem uma conta? Inscrever-se!', + 'Email' => 'Email', + 'Email (public)' => 'Email (publico)', + 'Enable' => 'Habilitado', + 'Enable Two-factor auth' => 'Habilitar autenticação em dois fatores', + 'Error occurred while changing password' => 'Ocorreu um erro ao mudar a senha', + 'Error occurred while confirming user' => 'Ocorreu um erro ao confirmar o usuário', + 'Error occurred while deleting user' => 'Ocorreu um erro ao excluir o usuário', + 'Error sending registration message to "{email}". Please try again later.' => 'Erro ao enviar a mensagem de registro para "{email}". Por favor, tente novamente mais tarde.', + 'Error sending welcome message to "{email}". Please try again later.' => 'Erro ao enviar a mensagem de boas-vindas para "{email}". Por favor, tente novamente mais tarde.', + 'Finish' => 'Terminar', + 'Forgot password?' => 'Esqueceu a senha?', + 'Gravatar email' => 'E-mail do Gravatar', + 'Hello' => 'Olá', + 'If you already registered, sign in and connect this account on settings page' => 'Se você já se registrou, faça login e conecte esta conta na página de configurações', + 'If you cannot click the link, please try pasting the text into your browser' => 'Se você não pode clicar no link, tente colar o texto em seu navegador', + 'If you did not make this request you can ignore this email' => 'Se você não fez essa solicitação, ignore este e-mail', + 'Impersonate this user' => 'Representar este usuário', + 'In order to complete your registration, please click the link below' => 'Para completar seu registro, clique no link abaixo', + 'In order to complete your request, please click the link below' => 'Para completar seu pedido, clique no link abaixo', + 'In order to finish your registration, we need you to enter following fields' => 'Para terminar seu registro, precisamos que você insira os seguintes campos', + 'Information' => 'Informação', + 'Invalid login or password' => 'Login ou senha inválidos', + 'Invalid or expired link' => 'Link inválido ou expirado', + 'Invalid two-factor code' => 'Código de dois fatores inválido', + 'Invalid value' => 'Valor inválido', + 'It will be deleted forever' => 'Ele será excluído para sempre', + 'Items' => 'Itens', + 'Joined on {0, date}' => 'Juntou-se em {0, date}', + 'Last login' => 'Último login', + 'Location' => 'Localização', + 'Login' => 'Entrar', + 'Logout' => 'Sair', + 'Manage users' => 'Gerenciar usuários', + 'Name' => 'Nome', + 'Networks' => 'Rede', + 'Never' => 'Nunca', + 'New email' => 'Novo Email', + 'New password' => 'Nova Senha', + 'New permission' => 'Nova permissão', + 'New role' => 'Nova função', + 'New rule' => 'Nova regra', + 'New user' => 'Novo usuário', + 'Not blocked' => 'Não bloqueado', + 'Not found' => 'Não encontrado', + 'Once you delete your account, there is no going back' => 'Depois de excluir sua conta, não há retorno', + 'Password' => 'Senha', + 'Password has been changed' => 'Senha alterada', + 'Permissions' => 'Permissões', + 'Please be certain' => 'Tenha certeza', + 'Please click the link below to complete your password reset' => 'Clique no link abaixo para completar a reposição da senha', + 'Please fix following errors:' => 'Corrija os seguintes erros:', + 'Profile' => 'Perfil', + 'Profile details' => 'Detalhes de perfil', + 'Profile details have been updated' => 'Os detalhes do perfil foram atualizados', + 'Profile settings' => 'Configuração de Perfil', + 'Recover your password' => 'Recupere sua senha', + 'Recovery link is invalid or expired. Please try requesting a new one.' => 'O link de recuperação é inválido ou expirou. Por favor, tente solicitar um novo.', + 'Recovery message sent' => 'Mensagem de recuperação enviada', + 'Registration IP' => 'IP de registro', + 'Registration on this website is disabled' => 'O registro neste site está desativado', + 'Registration time' => 'Tempo de registro', + 'Remember me next time' => 'Lembre-me da próxima vez', + 'Request new confirmation message' => 'Solicitar nova mensagem de confirmação', + 'Required "key" cannot be empty.' => 'A "chave" necessária não pode estar vazia.', + 'Required "secret" cannot be empty.' => 'O "segredo" necessário não pode estar vazio.', + 'Reset your password' => 'Redefinir sua senha', + 'Role "{0}" not found. Creating it.' => 'O função "{0}" não foi encontrado. Crie-a.', + 'Roles' => 'Função', + 'Rule' => 'Regra', + 'Rule class must extend "yii\\rbac\\Rule".' => 'A classe de regras deve estender de "yii\\rbac\\Rule".', + 'Rule name' => 'Nome da regra', + 'Rule name {0} is already in use' => 'O nome da regra {0} já está em uso', + 'Rule {0} does not exists' => 'A regra {0} não existe', + 'Rule {0} not found.' => 'Regra {0} não encontrada.', + 'Rules' => 'Regras', + 'Save' => 'Gravar', + 'Scan the QrCode with Google Authenticator App, then insert its temporary code on the box and submit.' => 'Digitalize o QrCode com o Google Authenticator App, então insira seu código temporário na caixa e envie.', + 'Send password recovery email' => 'Enviar email de recuperação de senha', + 'Sign in' => 'Criar conta', + 'Sign up' => 'Acessar', + 'Something went wrong' => 'Algo deu errado', + 'Switch identities is disabled.' => 'Alterar identidades está desabilitada.', + 'Thank you for signing up on {0}' => 'Obrigado por se inscrever no {0}', + 'Thank you, registration is now complete.' => 'Obrigado, o registro está completo.', + 'The "recaptcha" component must be configured.' => 'O componente "recaptcha" deve ser configurado.', + 'The confirmation link is invalid or expired. Please try requesting a new one.' => 'O link de confirmação é inválido ou expirou. Por favor, tente solicitar um novo.', + 'The verification code is incorrect.' => 'O código de verificação está incorreto.', + 'There is neither role nor permission with name "{0}"' => 'Não há papel nem permissão com o nome "{0}"', + 'This account has already been connected to another user' => 'Esta conta já foi conectada a outro usuário', + 'This email address has already been taken' => 'Este endereço de e-mail já foi feito', + 'This username has already been taken' => 'Este nome de usuário já foi feito', + 'This will disable two-factor auth. Are you sure?' => 'Isso desativará a autenticação de dois fatores. Você tem certeza?', + 'Time zone' => 'Fuso horário', + 'Time zone is not valid' => 'O fuso horário não é válido', + 'Two Factor Authentication' => 'Autenticação de dois fatores', + 'Two factor successfully enabled.' => 'Dois fatores habilitados com sucesso.', + 'Two-Factor Authentication' => 'Autenticação de dois fatores', + 'Two-factor auth protects you against stolen credentials' => 'Autenticação de dois fatores protege você contra credenciais roubadas', + 'Two-factor authentication code' => 'Código de autenticação de dois fatores', + 'Two-factor authorization has been disabled.' => 'A autorização de dois fatores foi desabilitada.', + 'Two-factor code' => 'Código de dois fatores', + 'Unable to confirm user. Please, try again.' => 'Não é possível confirmar o usuário. Por favor, tente novamente.', + 'Unable to create an account.' => 'Não é possível criar uma conta.', + 'Unable to create authorization item.' => 'Não foi possível criar o item de autorização.', + 'Unable to create new authorization rule.' => 'Não é possível criar uma nova regra de autorização.', + 'Unable to delete user. Please, try again later.' => 'Não é possível excluir o usuário. Por favor, tente novamente mais tarde.', + 'Unable to disable two-factor authorization.' => 'Não é possível desabilitar a autorização de dois fatores.', + 'Unable to remove authorization item.' => 'Não é possível remover o item de autorização.', + 'Unable to send confirmation link' => 'Não é possível enviar o link de confirmação', + 'Unable to send recovery message to the user' => 'Não é possível enviar uma mensagem de recuperação para o usuário', + 'Unable to update authorization item.' => 'Não foi possível atualizar o item de autorização.', + 'Unable to update authorization rule.' => 'Não é possível atualizar a regra de autorização', + 'Unable to update block status.' => 'Não é possível atualizar o status do bloco', + 'Unblock' => 'Desbloquear', + 'Unconfirmed' => 'Não confirmado', + 'Update' => 'Altera', + 'Update assignments' => 'Atualizar atribuições', + 'Update permission' => 'Permissão de atualização', + 'Update role' => 'Atualizar função', + 'Update rule' => 'Atualizar regra', + 'Update user account' => 'Atualizar conta de usuário', + 'Updated at' => 'Atualizado em', + 'User account could not be created.' => 'A conta de usuário não pôde ser criada', + 'User block status has been updated.' => 'O status do bloco do usuário foi atualizado', + 'User could not be registered.' => 'O usuário não pôde ser registrado.', + 'User has been confirmed' => 'O usuário foi confirmado', + 'User has been created' => 'O usuário foi criado', + 'User has been deleted' => 'O usuário foi excluído', + 'User is not found' => 'O usuário não foi encontrado', + 'User not found.' => 'O usuário não encontrado', + 'Username' => 'Nome de usuário', + 'Users' => 'Usuários', + 'VKontakte' => 'VKontakte', + 'Verification failed. Please, enter new code.' => 'Falha na verificação. Por favor, insira um novo código', + 'We couldn\'t re-send the mail to confirm your address. Please, verify is the correct email or if it has been confirmed already.' => 'Não foi possível re-enviar o email para confirmar o seu endereço. Por favor, verifique se o e-mail correto ou se já foi confirmado', + 'We have generated a password for you' => 'Nós geramos uma senha para você', + 'We have received a request to change the email address for your account on {0}' => 'Recebemos um pedido para alterar o endereço de e-mail da sua conta em {0}', + 'We have received a request to reset the password for your account on {0}' => 'Recebemos um pedido para redefinir a senha da sua conta em {0}', + 'We have sent confirmation links to both old and new email addresses. You must click both links to complete your request.' => 'Enviamos links de confirmação para endereços de e-mail antigo e novo. Você deve clicar em ambos os links para completar sua solicitação.', + 'Website' => 'Website', + 'Welcome to {0}' => 'Bem-vindo ao {0}', + 'Yandex' => 'Yandex', + 'You can assign multiple roles or permissions to user by using the form below' => 'Você pode atribuir várias funções ou permissões ao usuário usando o formulário abaixo', + 'You can connect multiple accounts to be able to log in using them' => 'Você pode conectar várias contas para poder fazer login usando elas', + 'You cannot remove your own account' => 'Você não pode remover sua própria conta', + 'You need to confirm your email address' => 'Você precisa confirmar seu endereço de e-mail', + 'Your account details have been updated' => 'Os detalhes da sua conta foram atualizados', + 'Your account has been blocked' => 'Sua conta foi bloqueada', + 'Your account has been blocked.' => 'Sua conta foi bloqueada.', + 'Your account has been completely deleted' => 'Sua conta foi completamente removida', + 'Your account has been connected' => 'Sua conta foi conectada', + 'Your account has been created' => 'Sua conta foi criada', + 'Your account has been created and a message with further instructions has been sent to your email' => 'Sua conta foi criada e uma mensagem com instruções adicionais foi enviada para o seu email', + 'Your account on {0} has been created' => 'Sua conta em {0} foi criada', + 'Your confirmation token is invalid or expired' => 'Seu token de confirmação é inválido ou expirou', + 'Your email address has been changed' => 'Seu endereço de e-mail foi alterado', + 'Your profile has been updated' => 'Seu perfil foi atualizado', + '{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, MMMM dd, YYYY HH:mm}', + '{0} cannot be blank.' => '{0} não pode estar em branco', + 'A message has been sent to your email address. ' => 'Uma mensagem foi enviada para o seu endereço de e-mail.', + 'Awesome, almost there. ' => 'Incrível, quase lá.', + 'Class "{0}" does not exist' => 'A classe "{0}" não existe', + 'Registration ip' => 'Registro ip', + 'Rule class can not be instantiated' => 'A classe de regras não pode ser instanciada', + 'Rule class must extend "yii\\rbac\\Rule"' => 'A classe de regras deve estender de "yii\\rbac\\Rule"', + 'We couldn\'t re-send the mail to confirm your address. ' => 'Não poderíamos re-enviar o correio para confirmar o seu endereço.', + 'We have sent confirmation links to both old and new email addresses. ' => 'Enviamos links de confirmação para endereços de e-mail antigo e novo.', ]; From b0d1f159aaae0ae6a9b968d0cefc2614aac2deb2 Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Fri, 27 Oct 2017 16:50:55 +0200 Subject: [PATCH 023/108] re #100 add credits to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc4c94e..ba44bb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.1.1 - Work in progress - Enh #99: Added German translation (jkmssoft) +- Enh #100: Added pt-BR translation (gugoan) ## 1.1.0 - October 22, 2017 - Enh #91: Documentation for Mail events (kartik-v) From 5c74c698b8de938124f4d42aabcff29691635e49 Mon Sep 17 00:00:00 2001 From: Lorenzo Milesi Date: Sat, 4 Nov 2017 14:49:31 +0100 Subject: [PATCH 024/108] Consolitation of 2FA messages #103 --- .../how-to-implement-two-factor-auth.md | 18 +++++++++--------- src/User/Controller/SettingsController.php | 6 +++--- src/User/Form/LoginForm.php | 4 ++-- src/User/resources/views/settings/account.php | 12 ++++++------ .../resources/views/settings/two-factor.php | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/helpful-guides/how-to-implement-two-factor-auth.md b/docs/helpful-guides/how-to-implement-two-factor-auth.md index da9ed9b..53ebf79 100644 --- a/docs/helpful-guides/how-to-implement-two-factor-auth.md +++ b/docs/helpful-guides/how-to-implement-two-factor-auth.md @@ -1,18 +1,18 @@ -How to Implement Two-Factor Auth -================================ +How to Implement Two Factor Auth (2FA) +====================================== -Two-Factor Authentication products add an additional layer of security. Typically, users are asked to prove their +Two Factor Authentication products add an additional layer of security. Typically, users are asked to prove their identity by providing simple credentials such as an email address and a password. A second factor (2F) adds an extra layer of unauthorized access protection by prompting the user to provide an additional means of authentication such as a physical token (e.g. a card) or an additional secret that only they know. -With this module is quite easy. It basically implements two-factor authentication using the following 2amigos libraries: +With this module is quite easy. It basically implements two factor authentication using the following 2amigos libraries: - [2amigos/2fa-library](https://github.com/2amigos/2fa-library) - [2amigos/qrcode-library](https://github.com/2amigos/qrcode-library) -Enable Two-Factor +Enable Two Factor ----------------- We simply need to enable two factor authentication: @@ -26,7 +26,7 @@ We simply need to enable two factor authentication: ] ``` -Now, when the user go to its settings via `user/settings`, it will display the option to enable two-factor +Now, when the user go to its settings via `user/settings`, it will display the option to enable two factor authentication or not. When enabled, the module will show a modal with a QrCode that has to be scanned by the Google Authenticator App @@ -35,15 +35,15 @@ When enabled, the module will show a modal with a QrCode that has to be scanned [iTunes](https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8)). The application will display a code that needs to be inserted into the modal input box. If code verification goes well, -it will enable the two-factor for the user. +it will enable the two factor for the user. -If a user has enabled the two-factor, and after successfully login via username and email, it will render a new section +If a user has enabled the two factor, and after successfully login via username and email, it will render a new section where user will have to enter the code displayed on its Google Authenticator App in order to complete with the login process. ### Recommended Reading -- [2amigos Two-Factor Library Docs]()http://2fa-library.readthedocs.io/en/latest/) +- [2amigos Two Factor Library Docs]()http://2fa-library.readthedocs.io/en/latest/) © [2amigos](http://www.2amigos.us/) 2013-2017 diff --git a/src/User/Controller/SettingsController.php b/src/User/Controller/SettingsController.php index f8fb71b..3d79ec7 100644 --- a/src/User/Controller/SettingsController.php +++ b/src/User/Controller/SettingsController.php @@ -280,7 +280,7 @@ class SettingsController extends Controller return [ 'success' => $success, 'message' => $success - ? Yii::t('usuario', 'Two factor successfully enabled.') + ? Yii::t('usuario', '2FA successfully enabled.') : Yii::t('usuario', 'Verification failed. Please, enter new code.') ]; } @@ -297,11 +297,11 @@ class SettingsController extends Controller if ($user->updateAttributes(['auth_tf_enabled' => '0'])) { Yii::$app ->getSession() - ->setFlash('success', Yii::t('usuario', 'Two-factor authorization has been disabled.')); + ->setFlash('success', Yii::t('usuario', '2FA has been disabled.')); } else { Yii::$app ->getSession() - ->setFlash('danger', Yii::t('usuario', 'Unable to disable two-factor authorization.')); + ->setFlash('danger', Yii::t('usuario', 'Unable to disable 2FA.')); } $this->redirect(['account']); diff --git a/src/User/Form/LoginForm.php b/src/User/Form/LoginForm.php index cd171eb..1946b7e 100644 --- a/src/User/Form/LoginForm.php +++ b/src/User/Form/LoginForm.php @@ -73,7 +73,7 @@ class LoginForm extends Model 'login' => Yii::t('usuario', 'Login'), 'password' => Yii::t('usuario', 'Password'), 'rememberMe' => Yii::t('usuario', 'Remember me next time'), - 'twoFactorAuthenticationCode' => Yii::t('usuario', 'Two-factor authentication code') + 'twoFactorAuthenticationCode' => Yii::t('usuario', '2FA code') ]; } @@ -111,7 +111,7 @@ class LoginForm extends Model $this->module->twoFactorAuthenticationCycles )) ->validate()) { - $this->addError($attribute, Yii::t('usuario', 'Invalid two-factor code')); + $this->addError($attribute, Yii::t('usuario', 'Invalid 2FA code')); } } ], diff --git a/src/User/resources/views/settings/account.php b/src/User/resources/views/settings/account.php index df29662..2982d95 100644 --- a/src/User/resources/views/settings/account.php +++ b/src/User/resources/views/settings/account.php @@ -81,7 +81,7 @@ $module = Yii::$app->getModule('user'); +
-

+

- . + .

$model->getUser()->id], [ 'id' => 'disable_tf_btn', 'class' => 'btn btn-warning ' . ($model->getUser()->auth_tf_enabled ? '' : 'hide'), 'data-method' => 'post', - 'data-confirm' => Yii::t('usuario', 'This will disable two-factor auth. Are you sure?'), + 'data-confirm' => Yii::t('usuario', 'This will disable 2FA. Are you sure?'), ] ) ?> 'enable_tf_btn', diff --git a/src/User/resources/views/settings/two-factor.php b/src/User/resources/views/settings/two-factor.php index d4d5527..0303075 100644 --- a/src/User/resources/views/settings/two-factor.php +++ b/src/User/resources/views/settings/two-factor.php @@ -29,7 +29,7 @@
- +

- . + .

$model->getUser()->id], [ 'id' => 'disable_tf_btn', 'class' => 'btn btn-warning ' . ($model->getUser()->auth_tf_enabled ? '' : 'hide'), 'data-method' => 'post', - 'data-confirm' => Yii::t('usuario', 'This will disable 2FA. Are you sure?'), + 'data-confirm' => Yii::t('usuario', 'This will disable two factor authentication. Are you sure?'), ] ) ?> 'enable_tf_btn', diff --git a/src/User/resources/views/settings/two-factor.php b/src/User/resources/views/settings/two-factor.php index 0303075..6434396 100644 --- a/src/User/resources/views/settings/two-factor.php +++ b/src/User/resources/views/settings/two-factor.php @@ -29,7 +29,7 @@
- +