Add session history
This commit is contained in:
60
docs/helpful-guides/how-to-use-session-history.md
Executable file
60
docs/helpful-guides/how-to-use-session-history.md
Executable file
@ -0,0 +1,60 @@
|
||||
How to enable session history
|
||||
============================
|
||||
|
||||
Session history is list user sessions.
|
||||
|
||||
User can delete all session except current.
|
||||
|
||||
Configure Module and Application
|
||||
--------------------------------
|
||||
|
||||
```php
|
||||
|
||||
// ...
|
||||
|
||||
'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:
|
||||

|
||||
|
||||
Admin screenshot:
|
||||

|
||||
|
||||
© [2amigos](http://www.2amigos.us/) 2013-2019
|
||||
BIN
docs/helpful-guides/session-history/admin.png
Executable file
BIN
docs/helpful-guides/session-history/admin.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 145 KiB |
BIN
docs/helpful-guides/session-history/settings.png
Executable file
BIN
docs/helpful-guides/session-history/settings.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
1
docs/index.md
Normal file → Executable file
1
docs/index.md
Normal file → Executable file
@ -187,6 +187,7 @@ Helpful Guides
|
||||
- [How to Switch Identities](helpful-guides/how-to-swith-identities.md)
|
||||
- [Separate Frontend and Backend Sessions](helpful-guides/separate-frontend-and-backend-sessions.md)
|
||||
- [Social Network Authentication](helpful-guides/social-network-authentication.md)
|
||||
- [How to Enable session history](helpful-guides/how-to-use-session-history.md)
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
16
docs/installation/configuration-options.md
Normal file → Executable file
16
docs/installation/configuration-options.md
Normal file → Executable file
@ -3,6 +3,22 @@ Configuration Options
|
||||
|
||||
The module comes with a set of attributes to configure. The following is the list of all available options:
|
||||
|
||||
#### enableSessionHistory (Type: `boolean, integer`, Default value: `false`)
|
||||
|
||||
If this option is to `true`, session history will be kept, [more](../helpful-guides/how-to-use-session-history.md).
|
||||
|
||||
#### numberSessionHistory (Type: `boolean, integer`, Default value: `false`)
|
||||
|
||||
Number of expired storing records `session history`, values:
|
||||
- `false` Store all records without deleting
|
||||
- `integer` Count of records for storing
|
||||
|
||||
#### timeoutSessionHistory (Type: `boolean, integer`, Default value: `false`)
|
||||
|
||||
How long store `session history` after expiring, values:
|
||||
- `false` Store all records without deleting
|
||||
- `integer` Time for storing after expiring
|
||||
|
||||
#### enableTwoFactorAuthentication (type: `boolean`, default: `false`)
|
||||
|
||||
Setting this attribute will allow users to configure their login process with two-factor authentication.
|
||||
|
||||
Reference in New Issue
Block a user