Skip to content
Browse files

Fixed issue #8489: Non-operational CAPTCHA due backup to resume later.

  • Loading branch information...
1 parent 24d3302 commit 3b999f8fd2920e1e8f374232ee22043ffc7b9b7e @c-schmitz c-schmitz committed Jan 15, 2014
Showing with 8 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +7 −5 application/helpers/frontend_helper.php
View
1 .gitignore
@@ -8,6 +8,7 @@
/tmp/*.lss
/tmp/*.png
/tmp/*.xls
+/tmp/*.lsa
/tmp/upload/fu*
/upload/.htaccess
/nbproject
View
12 application/helpers/frontend_helper.php
@@ -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']) ||
@@ -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
@@ -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!
@@ -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));

0 comments on commit 3b999f8

Please sign in to comment.
Something went wrong with that request. Please try again.