From 8a827e761e070b8ad9363e4d55e37066486dcaf2 Mon Sep 17 00:00:00 2001 From: bscheshirwork Date: Wed, 24 May 2017 11:36:25 +0300 Subject: [PATCH] ImpersonateUser fix https://github.com/dektrium/yii2-user/pull/893 --- views/admin/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/admin/index.php b/views/admin/index.php index ebb063d51..5fd8e610e 100644 --- a/views/admin/index.php +++ b/views/admin/index.php @@ -125,7 +125,7 @@ } }, 'switch' => function ($url, $model) { - if($model->id != Yii::$app->user->id && Yii::$app->getModule('user')->enableImpersonateUser) { + if($model->isAdmin && $model->id != Yii::$app->user->id && Yii::$app->getModule('user')->enableImpersonateUser) { return Html::a('', ['/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?'),