View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
08563Bug reportsSurvey participants (Tokens)public2014-01-25 17:22
Reporterledut Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary08563: Token validfrom and validuntil validations fail : they don't use the time difference setting
Description

Access to a token restricted survey fails when the Time Difference paramater is not set to zero and the period is to tiny.

Steps To Reproduce

1) go to admin/globalsettings, general tab, set the time difference to another value than zero.
As an example set it to 10 hours:
server time is '20/01/2014 09:10'
Corrected time: '20/01/2014 19:10'

2) create a survey.

3) create a token with validuntil and validfrom values for one hour period.
Validfrom : '20/01/2014 19:00'
validuntil : '20/01/2014 20:00'

  • try the token : LimeSurvey display the error below but the token should be valid.
    "We are sorry but you are not allowed to enter this survey."
    "Your token seems to be valid but can be used only during a certain time period."

4) edit the token to set it to the server time :
Validfrom : 20/01/2014 09:00
validuntil : 20/01/2014 10:00

5) try the survey :
The system allows to fill the survey (but it should not).

6) submit the survey

7) display token : you will see inconsistancy dates :
submitdate = 20/01/2014 19:15 !! (the submitdate is right but is not between the allowed period).
Validfrom : 20/01/2014 09:00
validuntil : 20/01/2014 10:00

Additional Information

The error did not exixts on v2.00+, build number 131009 : valid from and valid untill was checked into the application/controllers/survey/index.php file, line
490.

In order to fix it on v2.05 :
edit the application/models/Token.php file, line 140 replacing :
$now = date('Y-m-d H:i:s');
by $now = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", Yii::app()->getConfig("timeadjust"));

I have tested this fix and it works.

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)140116
I will donate to the project if issue is resolvedNo
Browsersrware
Database type & versionmysql dbversion 174
Server OS (if known)Windows 7
Webserver software & version (if known)Apache 2.0 (wamp)
PHP Version5.3.13

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2014-01-22 17:38

administrator   ~28092

Thank you very much!

c_schmitz

c_schmitz

2014-01-22 17:38

administrator   ~28093

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=13748

c_schmitz

c_schmitz

2014-01-25 17:22

administrator   ~28148

2.05+ Build 140125 released

Related Changesets

LimeSurvey: master 6e3cb7e5

2014-01-22 16:37:52

c_schmitz

Details Diff
Fixed issue 08563: Token validfrom and validuntil validations fail : they don't use the time difference setting - patch by ledut Affected Issues
08563
mod - application/models/Token.php Diff File

Issue History

Date Modified Username Field Change
2014-01-20 14:36 ledut New Issue
2014-01-21 11:41 c_schmitz Assigned To => c_schmitz
2014-01-21 11:41 c_schmitz Status new => assigned
2014-01-22 17:38 c_schmitz Note Added: 28092
2014-01-22 17:38 c_schmitz Status assigned => resolved
2014-01-22 17:38 c_schmitz Fixed in Version => 2.05+
2014-01-22 17:38 c_schmitz Resolution open => fixed
2014-01-22 17:38 c_schmitz Changeset attached => LimeSurvey master 6e3cb7e5
2014-01-22 17:38 c_schmitz Note Added: 28093
2014-01-25 17:22 c_schmitz Note Added: 28148
2014-01-25 17:22 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)