Skip to content

Commit

Permalink
Fixed issue #17955: newtest/Y in URL is not clearing session (#2294)
Browse files Browse the repository at this point in the history
Dev: move newtest check before all other action
  • Loading branch information
Shnoulle committed Apr 26, 2022
1 parent 8082779 commit 3a083cc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions application/controllers/survey/index.php
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 3a083cc

Please sign in to comment.