]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
delete session if required data not exists
authorpavlikov_maxim <truobleblyat@yandex.ru>
Sat, 27 Apr 2024 11:52:45 +0000 (14:52 +0300)
committerpavlikov_maxim <truobleblyat@yandex.ru>
Sat, 27 Apr 2024 11:52:45 +0000 (14:52 +0300)
erp24/controllers/SiteController.php

index a1e8a9b54144233b261abd2c89425d7c792f4318..75b023e6f14745113de85e6991cecb31d7f4a51c 100644 (file)
@@ -9,6 +9,7 @@ use yii\web\Response;
 use yii\filters\VerbFilter;
 use app\models\LoginForm;
 use app\models\ContactForm;
+use yii_app\records\Admin;
 use yii_app\records\CrmMenu;
 
 class SiteController extends Controller
@@ -52,13 +53,10 @@ class SiteController extends Controller
     public function actionIndex()
     {
         $session = Yii::$app->session;
-        if (isset($session['view_modules'])) {
-            return $this->render('index');
-        } else {
-            // если нет нужных данных, удаляем сессию и отправляем на главную
-            $session->destroy();
-            return $this->goHome();
+        if (!isset($session['view_modules'])) {
+            Yii::$app->user->identity->legacyFill();
         }
+        return $this->render('index');
     }
 
     /**