Skip to content

Commit

Permalink
Merge pull request #21 from enricodetoma/master
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
thyseus authored Jun 14, 2017
2 parents ffe298b + a8d4fe9 commit 4805971
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion models/UserSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public function search($params)
$query->andFilterWhere(['item_name' => $this->auth_item]);
}

$table_name = $query->modelClass::tableName();
$model = $query->modelClass;
$table_name = $model::tableName();

if ($this->created_at !== null) {
$date = strtotime($this->created_at);
Expand Down
2 changes: 1 addition & 1 deletion views/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
}
},
'switch' => function ($url, $model) {
if($model->isAdmin && $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('<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

0 comments on commit 4805971

Please sign in to comment.