Fix:
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:
@ -1,9 +1,9 @@
|
|||||||
How to enable session history
|
How to enable session history
|
||||||
============================
|
============================
|
||||||
|
|
||||||
Session history is list user sessions.
|
Session history list user sessions.
|
||||||
|
|
||||||
User can delete all session except current.
|
User can delete all sessions except current.
|
||||||
|
|
||||||
Configure Module and Application
|
Configure Module and Application
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Number of expired storing records `session history`, values:
|
|||||||
|
|
||||||
How long store `session history` after expiring, values:
|
How long store `session history` after expiring, values:
|
||||||
- `false` Store all records without deleting
|
- `false` Store all records without deleting
|
||||||
- `integer` Time for storing after expiring
|
- `integer` Time for storing after expiring in seconds
|
||||||
|
|
||||||
#### enableTwoFactorAuthentication (type: `boolean`, default: `false`)
|
#### enableTwoFactorAuthentication (type: `boolean`, default: `false`)
|
||||||
|
|
||||||
|
|||||||
@ -104,6 +104,11 @@ class AdminController extends Controller
|
|||||||
'actions' => ['switch-identity'],
|
'actions' => ['switch-identity'],
|
||||||
'roles' => ['@'],
|
'roles' => ['@'],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'allow' => $this->getModule()->enableSessionHistory,
|
||||||
|
'actions' => ['session-history', 'terminate-sessions'],
|
||||||
|
'roles' => ['admin'],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'allow' => true,
|
'allow' => true,
|
||||||
'roles' => ['admin'],
|
'roles' => ['admin'],
|
||||||
|
|||||||
@ -115,8 +115,6 @@ class SettingsController extends Controller
|
|||||||
'two-factor',
|
'two-factor',
|
||||||
'two-factor-enable',
|
'two-factor-enable',
|
||||||
'two-factor-disable',
|
'two-factor-disable',
|
||||||
'session-history',
|
|
||||||
'terminate-sessions',
|
|
||||||
],
|
],
|
||||||
'roles' => ['@'],
|
'roles' => ['@'],
|
||||||
],
|
],
|
||||||
@ -125,6 +123,11 @@ class SettingsController extends Controller
|
|||||||
'actions' => ['confirm'],
|
'actions' => ['confirm'],
|
||||||
'roles' => ['?', '@'],
|
'roles' => ['?', '@'],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'allow' => $this->getModule()->enableSessionHistory,
|
||||||
|
'actions' => ['session-history', 'terminate-sessions'],
|
||||||
|
'roles' => ['@'],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -13,6 +13,7 @@ use Da\User\Model\User;
|
|||||||
use yii\bootstrap\Nav;
|
use yii\bootstrap\Nav;
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
use yii\web\View;
|
use yii\web\View;
|
||||||
|
use Da\User\Module as UserModule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var View $this
|
* @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'][] = ['label' => Yii::t('usuario', 'Users'), 'url' => ['index']];
|
||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
|
|
||||||
|
/** @var UserModule $module */
|
||||||
|
$module = Yii::$app->getModule('user');
|
||||||
?>
|
?>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<?= $this->render(
|
<?= $this->render(
|
||||||
'/shared/_alert',
|
'/shared/_alert',
|
||||||
[
|
[
|
||||||
'module' => Yii::$app->getModule('user'),
|
'module' => $module,
|
||||||
]
|
]
|
||||||
) ?>
|
) ?>
|
||||||
|
|
||||||
@ -70,6 +73,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
[
|
[
|
||||||
'label' => Yii::t('usuario', 'Session history'),
|
'label' => Yii::t('usuario', 'Session history'),
|
||||||
'url' => ['/user/admin/session-history', 'id' => $user->id],
|
'url' => ['/user/admin/session-history', 'id' => $user->id],
|
||||||
|
'visible' => $module->enableSessionHistory,
|
||||||
],
|
],
|
||||||
'<hr>',
|
'<hr>',
|
||||||
[
|
[
|
||||||
|
|||||||
@ -11,9 +11,12 @@
|
|||||||
|
|
||||||
use yii\helpers\Html;
|
use yii\helpers\Html;
|
||||||
use yii\widgets\Menu;
|
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;
|
$user = Yii::$app->user->identity;
|
||||||
|
/** @var UserModule $module */
|
||||||
$module = Yii::$app->getModule('user');
|
$module = Yii::$app->getModule('user');
|
||||||
$networksVisible = count(Yii::$app->authClientCollection->clients) > 0;
|
$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', 'Account'), 'url' => ['/user/settings/account']],
|
||||||
[
|
[
|
||||||
'label' => Yii::t('usuario', 'Session history'),
|
'label' => Yii::t('usuario', 'Session history'),
|
||||||
'url' => ['/user/settings/session-history']
|
'url' => ['/user/settings/session-history'],
|
||||||
|
'visible' => $module->enableSessionHistory,
|
||||||
],
|
],
|
||||||
['label' => Yii::t('usuario', 'Privacy'),
|
['label' => Yii::t('usuario', 'Privacy'),
|
||||||
'url' => ['/user/settings/privacy'],
|
'url' => ['/user/settings/privacy'],
|
||||||
|
|||||||
Reference in New Issue
Block a user