Close #23 provide administrator with an option for user to reset its
password.
This commit is contained in:
@ -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;
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user