1. Documentation;
2. Actions access in AdminController and SettingController by enableSessionHistory;
3. Add "visible" menu parameter by enableSessionHistory;
4. Add blank line in end of file.
This commit is contained in:
maranqz
2019-11-30 17:52:24 +03:00
parent be2b495c9e
commit b7d2cf42ac
13 changed files with 31 additions and 15 deletions

View File

@ -65,4 +65,4 @@ use yii\data\ActiveDataProvider;
]); ?>
<?php Pjax::end(); ?>
<?php $this->endContent() ?>
<?php $this->endContent() ?>

View File

@ -13,6 +13,7 @@ use Da\User\Model\User;
use yii\bootstrap\Nav;
use yii\helpers\Html;
use yii\web\View;
use Da\User\Module as UserModule;
/**
* @var View $this
@ -24,12 +25,14 @@ $this->title = Yii::t('usuario', 'Update user account');
$this->params['breadcrumbs'][] = ['label' => Yii::t('usuario', 'Users'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
/** @var UserModule $module */
$module = Yii::$app->getModule('user');
?>
<div class="clearfix"></div>
<?= $this->render(
'/shared/_alert',
[
'module' => Yii::$app->getModule('user'),
'module' => $module,
]
) ?>
@ -70,6 +73,7 @@ $this->params['breadcrumbs'][] = $this->title;
[
'label' => Yii::t('usuario', 'Session history'),
'url' => ['/user/admin/session-history', 'id' => $user->id],
'visible' => $module->enableSessionHistory,
],
'<hr>',
[

View File

@ -11,9 +11,12 @@
use yii\helpers\Html;
use yii\widgets\Menu;
use Da\User\Module as UserModule;
use Da\User\Model\User;
/** @var \Da\User\Model\User $user */
/** @var User $user */
$user = Yii::$app->user->identity;
/** @var UserModule $module */
$module = Yii::$app->getModule('user');
$networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
@ -43,7 +46,8 @@ $networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
['label' => Yii::t('usuario', 'Account'), 'url' => ['/user/settings/account']],
[
'label' => Yii::t('usuario', 'Session history'),
'url' => ['/user/settings/session-history']
'url' => ['/user/settings/session-history'],
'visible' => $module->enableSessionHistory,
],
['label' => Yii::t('usuario', 'Privacy'),
'url' => ['/user/settings/privacy'],

View File

@ -76,4 +76,4 @@ $this->params['breadcrumbs'][] = $this->title;
</div>
</div>
</div>
</div>
</div>