Somebody, I have see http://192.241.236.31/themes/preview/smartadmin/1.4.1/ajaxversion/lock.html, it only inspiring… why web application not use lock screen…
How to implement lockscreen in Yii2 ?? Can somebody explain for me ?
Thank for advanced
Somebody, I have see http://192.241.236.31/themes/preview/smartadmin/1.4.1/ajaxversion/lock.html, it only inspiring… why web application not use lock screen…
How to implement lockscreen in Yii2 ?? Can somebody explain for me ?
Thank for advanced
We created this in our application. It isn’t easy, but it isn’t complicated either.
We created a on beforeRequest behaviour that do a lot of security stuff. One of those is to see if the user is actually locked or has its session expired ( We have special session controls based on user location on the system ). If the user is locked, it redirects to the locked screen:
[size="2"]
if($user->status === User::STATUS_LOCKED) {
Yii::$app->response->redirect(Url::to(['/your-are-locked']));
return false;
}
[/size]
This is a part of our main-local.php inside @common/config
use common\behaviors\BeginRequestBehavior;
return [
'components' => [
'mail' => [
...
],
],
],
//
'on beforeRequest' => function ($evento) {
BeginRequestBehavior::validateRequest();
},
];