From 3cf9f24a2091d381eab662fe399e453b573c3af6 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Tue, 4 May 2021 08:01:27 +1000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BA=D0=B8=D0=B4=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D1=8E=20=D1=84=D0=B0=D0=B9=D0=BB=20=D0=BD=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B5=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirzaev/skillparts/system/config/web.php.example | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) {