amic 8 months ago
parent
commit
bc0b9752e0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      controllers/InquirerController.php

+ 1 - 1
controllers/InquirerController.php

@@ -28,6 +28,7 @@ class InquirerController extends \yii\web\Controller
         return $this->renderPartial("widget",["model"=>$model]);
         return $this->renderPartial("widget",["model"=>$model]);
     }
     }
     public function actionAjax(){
     public function actionAjax(){
+		$this->enableCsrfValidation = false;
 		if(\Yii::$app->request->isPost){
 		if(\Yii::$app->request->isPost){
 			if(\Yii::$app->request->post('idq') && \Yii::$app->request->post('ask')  ){
 			if(\Yii::$app->request->post('idq') && \Yii::$app->request->post('ask')  ){
 				$ida = (int) \Yii::$app->request->post('ask');	//ответ
 				$ida = (int) \Yii::$app->request->post('ask');	//ответ
@@ -44,7 +45,6 @@ class InquirerController extends \yii\web\Controller
 					$session->set('askq_'.$idq.'_'.$hash, time());
 					$session->set('askq_'.$idq.'_'.$hash, time());
 
 
 					if( !$ret ){
 					if( !$ret ){
-						$this->enableCsrfValidation = false;
 						$log->add($idq, $ida, $hash);
 						$log->add($idq, $ida, $hash);
 						$answer = $model->getAnswer($idq, $ida);
 						$answer = $model->getAnswer($idq, $ida);
 						$answer->count++;
 						$answer->count++;