diff --git a/mirzaev/skillparts/system/config/web.php.example b/mirzaev/skillparts/system/config/web.php.example index 127b08e..342457d 100644 --- a/mirzaev/skillparts/system/config/web.php.example +++ b/mirzaev/skillparts/system/config/web.php.example @@ -107,6 +107,21 @@ $config = [ ] ], 'params' => require __DIR__ . '/params.php', + 'on beforeAction' => function ($event) { + if ( + !yii::$app->user->isGuest && + (yii::$app->request->getPathInfo() !== 'offer' && + yii::$app->request->getPathInfo() !== 'notification' && + yii::$app->request->getPathInfo() !== 'identification') && + (!isset(yii::$app->user->identity->acpt) || + yii::$app->user->identity->acpt === false) + ) { + // Нет соглашения с офертой + + // Переадресация на оферту + yii::$app->response->redirect('/offer')->send(); + } + } ]; if (YII_ENV_DEV) {