From 3a083ccab80737c6f650b8dbf50758a6cd10606f Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Tue, 26 Apr 2022 07:02:43 +0000 Subject: [PATCH] Fixed issue #17955: newtest/Y in URL is not clearing session (#2294) Dev: move newtest check before all other action --- application/controllers/survey/index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/application/controllers/survey/index.php b/application/controllers/survey/index.php index 3b53b805da6..096f7f6bf79 100644 --- a/application/controllers/survey/index.php +++ b/application/controllers/survey/index.php @@ -36,6 +36,12 @@ public function action() $thisstep = $param['thisstep']; $move = getMove(); + /* reset all session before all other action */ + if (isset($param['newtest']) && $param['newtest'] == "Y") { + killSurveySession($surveyid); + resetQuestionTimers($surveyid); + } + /* Get client token by POST or GET value */ $clienttoken = trim($param['token']); /* If not set : get by SESSION to avoid multiple submit of same token in different navigator */ @@ -75,11 +81,6 @@ public function action() $loadpass = $param['loadpass']; $sitename = Yii::app()->getConfig('sitename'); - if (isset($param['newtest']) && $param['newtest'] == "Y") { - killSurveySession($surveyid); - resetQuestionTimers($surveyid); - } - $surveyExists = ($oSurvey != null); $isSurveyActive = ($surveyExists && $oSurvey->isActive);