Skip to content

Commit

Permalink
Fixed issue #6708: Error messages not displaying at survey signup whe…
Browse files Browse the repository at this point in the history
…n user did not completely/correctly fill out the form
  • Loading branch information
c-schmitz committed Oct 16, 2012
1 parent 887eb23 commit 13ae777
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions application/controllers/RegisterController.php
Expand Up @@ -122,6 +122,7 @@ function actionIndex($surveyid = null)
}
if ($register_errormsg != "")
{
$_SESSION['survey_'.$surveyid]['register_errormsg']=$register_errormsg;
Yii::app()->request->redirect(Yii::app()->createUrl('survey/index/sid/'.$surveyid));
}

Expand All @@ -132,6 +133,7 @@ function actionIndex($surveyid = null)
if ($usrow)
{
$register_errormsg=$clang->gT("The email you used has already been registered.");
$_SESSION['survey_'.$surveyid]['register_errormsg']=$register_errormsg;
Yii::app()->request->redirect(Yii::app()->createUrl('survey/index/sid/'.$surveyid));
//include "index.php";
//exit;
Expand Down
6 changes: 5 additions & 1 deletion application/helpers/replacements_helper.php
Expand Up @@ -768,10 +768,14 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
{
$_endtext = $thissurvey['surveyls_endtext'];
}
if (isset($_SESSION['survey_'.$surveyid]) && isset($_SESSION['survey_'.$surveyid]['register_errormsg']))
{
$register_errormsg=$_SESSION['survey_'.$surveyid]['register_errormsg'];
unset($_SESSION['survey_'.$surveyid]['register_errormsg']);
}


// Set the array of replacement variables here - don't include curly braces

$coreReplacements = array();
$coreReplacements['ACTIVE'] = (isset($thissurvey['active']) && !($thissurvey['active'] != "Y"));
$coreReplacements['AID'] = isset($questiondetails['aid']) ? $questiondetails['aid'] : '';
Expand Down
4 changes: 2 additions & 2 deletions scripts/admin/questions.js
Expand Up @@ -16,10 +16,10 @@ $(document).ready(function(){
if ( key==null || key==0 || key==8 || key==9 || key==27 )
return true;
thischar=String.fromCharCode(key);
returnvalue=(thischar==thischar.replace(/['`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,''));
returnvalue=(thischar==thischar.replace(/['`~!@#$%^&*()|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,''));
return returnvalue;
});
$("body").delegate("#title", "keyup", function() {
$(this).val($(this).val().replace(/['`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,''));
$(this).val($(this).val().replace(/['`~!@#$%^&*()|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,''));
});
});

0 comments on commit 13ae777

Please sign in to comment.