View Issue Details

This issue affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
05210Bug reportsSurvey editingpublic2011-06-01 23:44
Reporterfvillerot Assigned Totpartner  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91 
Summary05210: Not the same presentation for all errors about token
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";

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)10120
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.1.31
Server OS (if known)Linux RHEL 5
Webserver software & version (if known)Apache 2.2.11
PHP VersionPHP 5.2.9

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-05-30 23:53

administrator   ~15177

Tony, do you mind having a look at this?

fvillerot

fvillerot

2011-05-31 09:06

reporter   ~15180

Attention, the editor "eats" the < p \ > in my code

tpartner

tpartner

2011-05-31 22:28

partner   ~15196

Fixed in revision 10159.

Thanks for the report fvillerot.

c_schmitz

c_schmitz

2011-06-01 23:44

administrator   ~15237

New 1.91+ version released.

Issue History

Date Modified Username Field Change
2011-05-30 14:58 fvillerot New Issue
2011-05-30 23:52 c_schmitz Assigned To => tpartner
2011-05-30 23:52 c_schmitz Status new => assigned
2011-05-30 23:53 c_schmitz Note Added: 15177
2011-05-31 09:06 fvillerot Note Added: 15180
2011-05-31 22:28 tpartner Note Added: 15196
2011-05-31 22:28 tpartner Status assigned => resolved
2011-05-31 22:28 tpartner Resolution open => fixed
2011-06-01 23:44 c_schmitz Note Added: 15237
2011-06-01 23:44 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing