init
This commit is contained in:
50
vendor/yiisoft/yii2-debug/views/default/panels/user/detail.php
vendored
Normal file
50
vendor/yiisoft/yii2-debug/views/default/panels/user/detail.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $panel yii\debug\panels\UserPanel */
|
||||
|
||||
use yii\bootstrap\Tabs;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
?>
|
||||
|
||||
<h1>User</h1>
|
||||
|
||||
<?php
|
||||
if (isset($panel->data['identity'])) {
|
||||
$items = [
|
||||
[
|
||||
'label' => 'User',
|
||||
'content' => '<h2>User Info</h2>' . DetailView::widget([
|
||||
'model' => $panel->data['identity'],
|
||||
'attributes' => $panel->data['attributes']
|
||||
]),
|
||||
'active' => true,
|
||||
],
|
||||
];
|
||||
if ($panel->data['rolesProvider'] || $panel->data['permissionsProvider']) {
|
||||
$items[] = [
|
||||
'label' => 'Roles and Permissions',
|
||||
'content' => $this->render('roles', ['panel' => $panel])
|
||||
];
|
||||
}
|
||||
|
||||
if ($panel->canSwitchUser()) {
|
||||
$items[] = [
|
||||
'label' => 'Switch User',
|
||||
'content' => $this->render(
|
||||
'switch',
|
||||
[
|
||||
'panel' => $panel
|
||||
]
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
echo Tabs::widget([
|
||||
'items' => $items,
|
||||
]);
|
||||
|
||||
} else {
|
||||
echo 'Is guest.';
|
||||
} ?>
|
||||
42
vendor/yiisoft/yii2-debug/views/default/panels/user/roles.php
vendored
Normal file
42
vendor/yiisoft/yii2-debug/views/default/panels/user/roles.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/* @var $panel yii\debug\panels\UserPanel */
|
||||
|
||||
use yii\grid\GridView;
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
if ($panel->data['rolesProvider']) {
|
||||
echo '<h2>Roles</h2>';
|
||||
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $panel->data['rolesProvider'],
|
||||
'columns' => [
|
||||
'name',
|
||||
'description',
|
||||
'ruleName',
|
||||
'data',
|
||||
'createdAt:datetime',
|
||||
'updatedAt:datetime'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
if ($panel->data['permissionsProvider']) {
|
||||
echo '<h2>Permissions</h2>';
|
||||
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $panel->data['permissionsProvider'],
|
||||
'columns' => [
|
||||
'name',
|
||||
'description',
|
||||
'ruleName',
|
||||
'data',
|
||||
'createdAt:datetime',
|
||||
'updatedAt:datetime'
|
||||
]
|
||||
]);
|
||||
} ?>
|
||||
|
||||
25
vendor/yiisoft/yii2-debug/views/default/panels/user/summary.php
vendored
Normal file
25
vendor/yiisoft/yii2-debug/views/default/panels/user/summary.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $panel yii\debug\panels\UserPanel */
|
||||
?>
|
||||
<div class="yii-debug-toolbar__block">
|
||||
<a href="<?= $panel->getUrl() ?>">
|
||||
<?php if (!isset($panel->data['id'])): ?>
|
||||
<span class="yii-debug-toolbar__label">Guest</span>
|
||||
<?php else: ?>
|
||||
<?php if ($panel->getUser()->isGuest || $panel->userSwitch->isMainUser()): ?>
|
||||
User <span
|
||||
class="yii-debug-toolbar__label yii-debug-toolbar__label_info"><?= $panel->data['id'] ?></span>
|
||||
<?php else: ?>
|
||||
User switching <span
|
||||
class="yii-debug-toolbar__label yii-debug-toolbar__label_warning"><?= $panel->data['id'] ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($panel->canSwitchUser()): ?>
|
||||
<span class="yii-debug-toolbar__switch-icon yii-debug-toolbar__userswitch"
|
||||
id="yii-debug-toolbar__switch-users">
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</div>
|
||||
65
vendor/yiisoft/yii2-debug/views/default/panels/user/switch.php
vendored
Normal file
65
vendor/yiisoft/yii2-debug/views/default/panels/user/switch.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\bootstrap\Html;
|
||||
use yii\debug\UserswitchAsset;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $panel yii\debug\panels\UserPanel */
|
||||
|
||||
UserswitchAsset::register($this);
|
||||
|
||||
echo '<h2>Switch user</h2>';
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<?php $formSet = ActiveForm::begin([
|
||||
'action' => \yii\helpers\Url::to(['user/set-identity']),
|
||||
'layout' => 'horizontal',
|
||||
'options' => [
|
||||
'id' => 'debug-userswitch__set-identity',
|
||||
'style' => $panel->canSearchUsers() ? 'display:none' : ''
|
||||
]
|
||||
]);
|
||||
echo $formSet->field(
|
||||
$panel->userSwitch,
|
||||
'user[id]', ['options' => ['class' => '']])
|
||||
->textInput(['id' => 'user_id', 'name' => 'user_id'])
|
||||
->label('Switch User');
|
||||
echo Html::submitButton('Switch', ['class' => 'btn btn-primary']);
|
||||
ActiveForm::end();
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<?php
|
||||
if (!$panel->userSwitch->isMainUser()) {
|
||||
$formReset = ActiveForm::begin([
|
||||
'action' => \yii\helpers\Url::to(['user/reset-identity']),
|
||||
'options' => [
|
||||
'id' => 'debug-userswitch__reset-identity',
|
||||
]
|
||||
]);
|
||||
echo Html::submitButton('Reset to <span class="yii-debug-toolbar__label yii-debug-toolbar__label_info">' .
|
||||
$panel->userSwitch->getMainUser()->getId() .
|
||||
'</span>', ['class' => 'btn btn-default']);
|
||||
ActiveForm::end();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ($panel->canSearchUsers()) {
|
||||
\yii\widgets\Pjax::begin(['id' => 'debug-userswitch__filter', 'timeout' => false]);
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $panel->getUserDataProvider(),
|
||||
'filterModel' => $panel->getUsersFilterModel(),
|
||||
'tableOptions' => [
|
||||
'class' => 'table table-bordered table-responsive table-hover table-pointer'
|
||||
],
|
||||
'columns' => $panel->filterColumns
|
||||
]);
|
||||
\yii\widgets\Pjax::end();
|
||||
}
|
||||
Reference in New Issue
Block a user