Commit a7ebdb35 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] Avoir delete unexist session

parent b244d3a9
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @author Denis Chenu <denis@sondages.pro> * @author Denis Chenu <denis@sondages.pro>
* @copyright 2018-2021 Denis Chenu <http://www.sondages.pro> * @copyright 2018-2021 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3 * @license AGPL v3
* @version 4.1.1 * @version 4.1.2
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -985,6 +985,10 @@ class reloadAnyResponse extends PluginBase ...@@ -985,6 +985,10 @@ class reloadAnyResponse extends PluginBase
} }
$surveyId = Yii::app()->getRequest()->getParam('sid'); $surveyId = Yii::app()->getRequest()->getParam('sid');
$responseId = Yii::app()->getRequest()->getParam('srid'); $responseId = Yii::app()->getRequest()->getParam('srid');
if(\reloadAnyResponse\Utilities::getCurrentReloadedSrid($surveyId) != $responseId && \reloadAnyResponse\Utilities::getCurrentSrid($surveyId) != $responseId) {
\Yii::log(sprintf("Try to reset session for %s in %s", $responseId, $surveyId), \CLogger::LEVEL_INFO, 'plugin.reloadAnyResponse.newDirectRequest');
return;
}
if ($surveyId && $responseId) { if ($surveyId && $responseId) {
\reloadAnyResponse\models\surveySession::model()->deleteByPk(array('sid'=>$surveyId,'srid'=>$responseId)); \reloadAnyResponse\models\surveySession::model()->deleteByPk(array('sid'=>$surveyId,'srid'=>$responseId));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment