Files
yii2-usuario/docs/helpful-guides/how-to-use-session-history.md
maranqz b7d2cf42ac 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.
2019-11-30 17:52:24 +03:00

1.1 KiB
Executable File

How to enable session history

Session history list user sessions.

User can delete all sessions except current.

Configure Module and Application


// ... 

'modules' => [
    'user' => [
        'class' => Da\User\Module::class,
        'enableSessionHistory' => true,
    ]
], 

// ...

'components' => [
    'session' => Da\User\Service\SessionHistory\SessionHistoryDecorator::class,
]

// ...

'container' => [
    'singletons' => [
        Da\User\Service\SessionHistory\TerminateSessionsServiceInterface::class => Da\User\Service\SessionHistory\TerminateSessionsService::class
    ]
]

// ...

'controllerMap' => [
    'migrate' => [
        ...
        'migrationNamespaces' => [
            'Da\User\Migration\Session',
        ],
    ],
],

Additionally for upping migration can use

./yii migrate --migrationNamespaces=Da\\User\\Migration\Session

Setting user screenshot: Settings user screenshot

Admin screenshot: Admin screenshot

© 2amigos 2013-2019