Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions views/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@
'template' => '{switch} {resend_password} {update} {delete}',
'buttons' => [
'resend_password' => function ($url, $model, $key) {
if ($model->isAdmin) {
if (\Yii::$app->user->identity->isAdmin && !$model->isAdmin) {
return '
<a data-method="POST" data-confirm="' . Yii::t('user', 'Are you sure?') . '" href="' . Url::to(['resend-password', 'id' => $model->id]) . '">
<span title="' . Yii::t('user', 'Generate and send new password to user') . '" class="glyphicon glyphicon-envelope">
</span> </a>';
}
},
'switch' => function ($url, $model) {
if($model->isAdmin && $model->id != Yii::$app->user->id && Yii::$app->getModule('user')->enableImpersonateUser) {
if(\Yii::$app->user->identity->isAdmin && $model->id != Yii::$app->user->id && Yii::$app->getModule('user')->enableImpersonateUser) {
return Html::a('<span class="glyphicon glyphicon-user"></span>', ['/user/admin/switch', 'id' => $model->id], [
'title' => Yii::t('user', 'Become this user'),
'data-confirm' => Yii::t('user', 'Are you sure you want to switch to this user for the rest of this Session?'),
Expand Down