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('/'); } }