- Posts: 16
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Change 'Valid Until" date for all Tokens of an active survey
- Effenberg0x0
- Topic Author
- Offline
- New Member
Less
More
7 years 2 weeks ago #149573
by Effenberg0x0
Change 'Valid Until" date for all Tokens of an active survey was created by Effenberg0x0
Hi,
I had to extend the expiry date of a survey (in survey settings). However, users still see the survey expired message when they try to access using the the tokens they got via email, because each token "Valid Until" date would have to be adjusted (all are expired).
It's more than 5,000 tokens... Editing one by one would take a lifetime.
Is there any way I can fix this?
Thanks!
Effenberg
I had to extend the expiry date of a survey (in survey settings). However, users still see the survey expired message when they try to access using the the tokens they got via email, because each token "Valid Until" date would have to be adjusted (all are expired).
It's more than 5,000 tokens... Editing one by one would take a lifetime.
Is there any way I can fix this?
Thanks!
Effenberg
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
7 years 2 weeks ago #149576
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Change 'Valid Until" date for all Tokens of an active survey
You can export the token table, edit the CSV file and re-import the tokens. Make sure you have a complete back-up first and edit the file with a decent tool like LibreOffice Calc.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1223
- Thank you received: 351
7 years 2 weeks ago - 7 years 2 weeks ago #149577
by Ben_V
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Replied by Ben_V on topic Change 'Valid Until" date for all Tokens of an active survey
... or use a SQL query if you can access the database:
Where "12345" is your survey ID
Code:
UPDATE `lime_tokens_12345` SET `validuntil`= "2020-01-01 00:00:00"
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 7 years 2 weeks ago by Ben_V.
The topic has been locked.
- Effenberg0x0
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 2
7 years 2 weeks ago #149578
by Effenberg0x0
Replied by Effenberg0x0 on topic Change 'Valid Until" date for all Tokens of an active survey
Export Tokens CSV / Edit / Import CSV:
Limesurvey won't update existing tokens if I import the edited CSV. The procedure would have to be:
- Export tokens CSV;
- Delete tokens table. Limesurvey says the survey will not require tokens for access from now on;
- Edit CSV;
- Create new empty tokens table;
- Import edited CSV;
- Check whether settings to require tokens for access persisted;
- Pray things still work and tokens are still associated to existing complete/partial responses.
I am not a particularly lucky person, I think it would probably destroy the survey beyond repair if I proceeded, so I did not.
SQL Query:
Worked like a charm!
Thank you guys!
Regards,
Effenberg
Limesurvey won't update existing tokens if I import the edited CSV. The procedure would have to be:
- Export tokens CSV;
- Delete tokens table. Limesurvey says the survey will not require tokens for access from now on;
- Edit CSV;
- Create new empty tokens table;
- Import edited CSV;
- Check whether settings to require tokens for access persisted;
- Pray things still work and tokens are still associated to existing complete/partial responses.
I am not a particularly lucky person, I think it would probably destroy the survey beyond repair if I proceeded, so I did not.
SQL Query:
Worked like a charm!
Thank you guys!
Regards,
Effenberg
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
7 years 2 weeks ago #149583
by jelo
a) a maintenance screen or/and
b) a selection column replacement
During exporting and modifying the CSV-tokenlist the survey goes on. What if something has changed during that timespan (e.g. Usages left changed)?
The importmode should be allowing replacement, partial replacement and appending.
Feature request is here:
bugs.limesurvey.org/view.php?id=12167
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Change 'Valid Until" date for all Tokens of an active survey
That sounds like a feature request. But even if replacement would be possible, we needEffenberg0x0 wrote: Export Tokens CSV / Edit / Import CSV:
Limesurvey won't update existing tokens if I import the edited CSV.
a) a maintenance screen or/and
b) a selection column replacement
During exporting and modifying the CSV-tokenlist the survey goes on. What if something has changed during that timespan (e.g. Usages left changed)?
The importmode should be allowing replacement, partial replacement and appending.
Feature request is here:
bugs.limesurvey.org/view.php?id=12167
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: Ben_V
The topic has been locked.
- Effenberg0x0
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 2
7 years 2 weeks ago #149586
by Effenberg0x0
Replied by Effenberg0x0 on topic Change 'Valid Until" date for all Tokens of an active survey
I completely agree with you Jelo. Thank you very much for creating the feature request.
Regards,
Effenberg
Regards,
Effenberg
The topic has been locked.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1223
- Thank you received: 351
7 years 2 weeks ago #149621
by Ben_V
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Replied by Ben_V on topic Change 'Valid Until" date for all Tokens of an active survey
Waiting for some enhancements, following SQL queries/syntaxes remain useful for users needing to update their [lime]_tokens[12345] table...
Code:
UPDATE `lime_tokens_12345` SET `usesleft` = '999' UPDATE `lime_tokens_12345` SET `usesleft` = '999' WHERE `tid` < 10 UPDATE `lime_tokens_12345` SET `validfrom`= "2017-01-01 00:00:00" UPDATE `lime_tokens_12345` SET `validfrom`= "2017-01-01 00:00:00" WHERE `tid` < 10 UPDATE `lime_tokens_12345` SET `validuntil`= "2020-01-01 00:00:00" UPDATE `lime_tokens_12345` SET `validuntil`= "2020-01-01 00:00:00" WHERE `tid` < 10 UPDATE `lime_tokens_12345` SET `completed`= "Y" UPDATE `lime_tokens_12345` SET `completed`= "Y" WHERE `tid` < 10
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: tpartner
The topic has been locked.