Skip to content

Commit

Permalink
Fixed issue #8489: Non-operational CAPTCHA due backup to resume later.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Jan 15, 2014
1 parent 24d3302 commit 3b999f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,6 +8,7 @@
/tmp/*.lss
/tmp/*.png
/tmp/*.xls
/tmp/*.lsa
/tmp/upload/fu*
/upload/.htaccess
/nbproject
Expand Down
12 changes: 7 additions & 5 deletions application/helpers/frontend_helper.php
Expand Up @@ -859,9 +859,8 @@ function buildsurveysession($surveyid,$preview=false)
$loadsecurity = returnGlobal('loadsecurity',true);

// NO TOKEN REQUIRED BUT CAPTCHA ENABLED FOR SURVEY ACCESS
if ($tokensexist == 0 && isCaptchaEnabled('surveyaccessscreen',$thissurvey['usecaptcha']) && !$preview)
if ($tokensexist == 0 && isCaptchaEnabled('surveyaccessscreen',$thissurvey['usecaptcha']) && !isset($_SESSION['survey_'.$surveyid]['captcha_surveyaccessscreen'])&& !$preview)
{

// IF CAPTCHA ANSWER IS NOT CORRECT OR NOT SET
if (!isset($loadsecurity) ||
!isset($_SESSION['survey_'.$surveyid]['secanswer']) ||
Expand All @@ -872,9 +871,9 @@ function buildsurveysession($surveyid,$preview=false)
// No or bad answer to required security question

$redata = compact(array_keys(get_defined_vars()));
echo templatereplace(file_get_contents($sTemplatePath."startpage.pstpl"),array(),$redata,'frontend_helper[1525]');
echo templatereplace(file_get_contents($sTemplatePath."startpage.pstpl"),array(),$redata,'frontend_helper[875]');
//echo makedropdownlist();
echo templatereplace(file_get_contents($sTemplatePath."survey.pstpl"),array(),$redata,'frontend_helper[1527]');
echo templatereplace(file_get_contents($sTemplatePath."survey.pstpl"),array(),$redata,'frontend_helper[877]');

if (isset($loadsecurity))
{ // was a bad answer
Expand Down Expand Up @@ -918,6 +917,9 @@ function buildsurveysession($surveyid,$preview=false)
doFooter();
exit;
}
else{
$_SESSION['survey_'.$surveyid]['captcha_surveyaccessscreen']=true;
}
}

//BEFORE BUILDING A NEW SESSION FOR THIS SURVEY, LET'S CHECK TO MAKE SURE THE SURVEY SHOULD PROCEED!
Expand Down Expand Up @@ -1041,7 +1043,7 @@ function buildsurveysession($surveyid,$preview=false)
if (isset($loadsecurity) &&
isset($_SESSION['survey_'.$surveyid]['secanswer']) &&
$loadsecurity == $_SESSION['survey_'.$surveyid]['secanswer'])
{
{
if ($thissurvey['alloweditaftercompletion'] == 'Y' )
{
$oTokenEntry = Token::model($surveyid)->findByAttributes(array('token'=> $clienttoken));
Expand Down

0 comments on commit 3b999f8

Please sign in to comment.