From 5d9228ec1b9cb9f93f2520aa71625ffb2c546dbe Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Tue, 4 May 2021 08:20:21 +1000 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=B4=D1=82=D0=B2=D0=B5=D1=80=D0=B6=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=84=D0=B5=D1=80=D1=82=D1=8B?= =?UTF-8?q?=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D1=81=D0=B5=D1=81=D1=81?= =?UTF-8?q?=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirzaev/skillparts/system/config/web.php.example | 4 +++- mirzaev/skillparts/system/controllers/OfferController.php | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mirzaev/skillparts/system/config/web.php.example b/mirzaev/skillparts/system/config/web.php.example index 342457d..2118bf1 100644 --- a/mirzaev/skillparts/system/config/web.php.example +++ b/mirzaev/skillparts/system/config/web.php.example @@ -110,9 +110,11 @@ $config = [ 'on beforeAction' => function ($event) { if ( !yii::$app->user->isGuest && + !(isset(yii::$app->session['offer_accepted']) && yii::$app->session['offer_accepted']) && (yii::$app->request->getPathInfo() !== 'offer' && yii::$app->request->getPathInfo() !== 'notification' && - yii::$app->request->getPathInfo() !== 'identification') && + yii::$app->request->getPathInfo() !== 'identification' && + yii::$app->request->getPathInfo() !== 'offer/accept') && (!isset(yii::$app->user->identity->acpt) || yii::$app->user->identity->acpt === false) ) { diff --git a/mirzaev/skillparts/system/controllers/OfferController.php b/mirzaev/skillparts/system/controllers/OfferController.php index c402240..bb58c18 100644 --- a/mirzaev/skillparts/system/controllers/OfferController.php +++ b/mirzaev/skillparts/system/controllers/OfferController.php @@ -21,6 +21,10 @@ class OfferController extends Controller if (yii::$app->user->identity->save()) { // Удалось записать данные + // Запись в сессию + yii::$app->session['offer_accepted'] = true; + + yii::$app->response->redirect('/'); } }