Merge branch 'session-histroy' of https://github.com/maranqz/yii2-usuario
This commit is contained in:
31
src/User/Module.php
Normal file → Executable file
31
src/User/Module.php
Normal file → Executable file
@ -22,6 +22,21 @@ use yii\helpers\Html;
|
||||
*/
|
||||
class Module extends BaseModule
|
||||
{
|
||||
/**
|
||||
* @var bool Enable the 'session history' function
|
||||
* Using with {@see SessionHistoryDecorator}
|
||||
*/
|
||||
public $enableSessionHistory = false;
|
||||
/**
|
||||
* @var int|bool The number of 'session history' records will be stored for user
|
||||
* if equals false records will not be deleted
|
||||
*/
|
||||
public $numberSessionHistory = false;
|
||||
/**
|
||||
* @var int|bool The time after which the expired 'session history' will be deleted
|
||||
* if equals false records will not be deleted
|
||||
*/
|
||||
public $timeoutSessionHistory = false;
|
||||
/**
|
||||
* @var bool whether to enable european G.D.P.R. compliance.
|
||||
* This will add a few elements to comply with european general data protection regulation.
|
||||
@ -251,4 +266,20 @@ class Module extends BaseModule
|
||||
|
||||
return $this->gdprConsentMessage ?: $defaultConsentMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasNumberSessionHistory()
|
||||
{
|
||||
return $this->numberSessionHistory !== false && $this->numberSessionHistory > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasTimeoutSessionHistory()
|
||||
{
|
||||
return $this->timeoutSessionHistory !== false && $this->timeoutSessionHistory > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user