| Description | Some token validy checks are made in index.php, but the errors are displayed without uniform presentation.
(1) //Check if TOKEN is used for EVERY PAGE
//check if tokens actually haven't been already used
//TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
echo "\t<center> \n" ... => no class, no id, nothing
//check if token is in a valid time frame
//TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
echo "\t<center> \n" ... => no class, no id, nothing
(2) buildsurveysession function
// NO TOKEN REQUIRED BUT CAPTCHA ENABLED FOR SURVEY ACCESS
echo "<p class='captcha'>". ...
...
// TOKEN REQUIRED BUT NO TOKEN PROVIDED
echo '<div id="wrapper"><p id="tokenmessage">'. ...
...
// TOKENS REQUIRED, A TOKEN PROVIDED
// SURVEY WITH NO NEED TO USE CAPTCHA
//TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
echo '<div id="wrapper"><p id="tokenmessage">'. ...
...
// TOKENS REQUIRED, A TOKEN PROVIDED
// SURVEY CAPTCHA REQUIRED
//TOKEN DOESN'T EXIST OR HAS ALREADY BEEN USED. EXPLAIN PROBLEM AND EXIT
echo "\t<center> \n" => no class, no id, nothing
...
// IF CAPTCHA ANSWER IS NOT CORRECT
echo '<div id="wrapper"><p id="tokenmessage">';
... |
|---|
| Additional Information | I propose to replace this (669-674)
echo "\t<center> \n"
."\t".$clang->gT("This is a closed-access survey, so you must supply a valid token. Please contact the administrator for assistance.")."
\n"
."\t".$clang->gT("The token you have provided is either not valid, or has already been used.")."\n"
."\t".sprintf($clang->gT("For further information please contact %s"), $thissurvey['adminname'])
." (<a href='mailto:{$thissurvey['adminemail']}'>"
."{$thissurvey['adminemail']}</a>)
\n";
by that (only the first and last lines change)
echo "<div id='wrapper'><p id='tokenmessage'>\n"
."\t".$clang->gT("This is a closed-access survey, so you must supply a valid token. Please contact the administrator for assistance.")."
\n"
."\t".$clang->gT("The token you have provided is either not valid, or has already been used.")."\n"
."\t".sprintf($clang->gT("For further information please contact %s"), $thissurvey['adminname'])
." (<a href='mailto:{$thissurvey['adminemail']}'>"
."{$thissurvey['adminemail']}</a>) </div>\n";
and this (700-705)
echo "\t<center> \n"
."\t<span>".$clang->gT("We are sorry but you are not allowed to enter this survey.")."</span>
\n"
."\t".$clang->gT("Your token seems to be valid but can be used only during a certain time period.")." \n"
."\t".sprintf($clang->gT("For further information please contact %s"), $thissurvey['adminname']
." (<a href='mailto:{$thissurvey['adminemail']}'>"
."{$thissurvey['adminemail']}</a>)")."
\n";
by that (only the first and last lines change)
echo "<div id='wrapper'><p id='tokenmessage'>\n"
."\t<span>".$clang->gT("We are sorry but you are not allowed to enter this survey.")."</span>
\n"
."\t".$clang->gT("Your token seems to be valid but can be used only during a certain time period.")." \n"
."\t".sprintf($clang->gT("For further information please contact %s"), $thissurvey['adminname']
." (<a href='mailto:{$thissurvey['adminemail']}'>"
."{$thissurvey['adminemail']}</a>) </div>\n";
in buildsurveysession function, I propose to replace this (2486-2491)
echo "\t<center> \n"
."\t".$clang->gT("This is a controlled survey. You need a valid token to participate.")."
\n"
."\t".$clang->gT("The token you have provided is either not valid, or has already been used.")." \n"
."\t".sprintf($clang->gT("For further information please contact %s"), $thissurvey['adminname'])
." (<a href='mailto:{$thissurvey['adminemail']}'>"
."{$thissurvey['adminemail']}</a>)
\n";
by that (exact copy from lines 2443-2447)
echo '<div id="wrapper"><p id="tokenmessage">'.$clang->gT("This is a controlled survey. You need a valid token to participate.")."
\n"
."\t".$clang->gT("The token you have provided is either not valid, or has already been used.")." \n"
."\t".sprintf($clang->gT("For further information please contact %s"), $thissurvey['adminname'])
." (<a href='mailto:{$thissurvey['adminemail']}'>"
."{$thissurvey['adminemail']}</a>) </div>\n"; |
|---|