Close #23 provide administrator with an option for user to reset its

password.
This commit is contained in:
Antonio Ramirez
2017-10-15 23:00:21 +02:00
parent 42301d0fb1
commit 1fa2e5b66d
30 changed files with 130 additions and 11 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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;
@ -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']);
}
}

View File

@ -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 */

View File

@ -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
*/

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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' => '',

View File

@ -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.',
];

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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.' => '',

View File

@ -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(
'<span class="glyphicon glyphicon-flash"></span>',
['/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;
}
]