Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How do I change the page requesting a token for authentication? (copied)

  • eschneider
  • eschneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 11 months ago #77979 by eschneider
I want to change how the authentication "page" works. The attached text appears to be the default. We would like to use another word other than "Token" and include an image and message that would assure the user it's us and safe to proceed. Where is that page? It does not appear to be the Welcome page but I'm new to Lime and can't say that for sure.
Thanks

I copied this from the Installation category once I saw where it went. Sorry for duplication. This was my first post - I'll know better next time.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
11 years 11 months ago #78001 by Mazi
You can change the text by editing the translation file.

As for the layout, have a look at the template editor, there is a sub-file for the registration screen if I remember correctly.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • eschneider
  • eschneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 11 months ago #78049 by eschneider
Mazi,

Thanks for your reply. However I am not trying to translate the text on the page, I am trying to replace it so it matches an existing survey which combines their own English text with a field to supply the "Token" which is identified in a mail letter as the "Online Survey Identifier" and assures the recipient much like a privacy statement. I also looked at the register page and believe that the text I am trying to replace is not part of the register page. The "page" I am trying to locate has the following text -

This is a controlled survey. You need a valid token to participate.
If you have been issued a token, please enter it in the box below and click continue.

If translation is the only way to accomplish this I will look further into it. On the face of it translation does not seem appropriate.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 11 months ago #78077 by DenisChenu

eschneider wrote: If translation is the only way to accomplish this I will look further into it. On the face of it translation does not seem appropriate.

Hello,

You can do it in javascript, in template.js, you can do something like that:
Code:
$(document).ready(function(){
    if (typeof tokenlabel === "undefined"){
        tokenlabel ="YOUR TOKEN LABEL : ";
    }
    if (typeof tokentext === "undefined"){
        tokentext ="YOUR TOKEN TEXT DESCRIPTION";
    }
    if (typeof tokenerror === "undefined"){
        tokenerror ="<br><br><strong class='error'>YOUR ERROR MESSAGE.</strong>";
    }
 
   if ($("#tokenform").length )
   {
        $("#tokenmessage").html(tokentext);
        $("label[for='token']").text(tokenlabel);
   }
   else
   {
       $("#tokenmessage").html(tokentext+tokenerror);
   }
 
});

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • eschneider
  • eschneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 11 months ago #78134 by eschneider
Denis,

Your reply was very helpful and addresses several of the issues we expected we would have to deal with to fully handle the token field.

What we also want to do is replace the text on the page in general. By experimenting we've been able to modify the text on the "Register" page but the page I'm calling the "authentication" page is not impacted by those modifications. That leads us to believe it is another page/place we would need to modify. Can you point us to it as we have been unable to find it?

Thanks
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 11 months ago #78230 by DenisChenu
Hello,

I don't have a look at register HTML,

But something like
Code:
$('.register-message-1').html('The first line, bold in default template');
$('.register-message-2').html('The second line, use <br /> for line feed');
 
$('table.register td:nth-child(1)'.html('firstname replace');
$('table.register td:nth-child(3)'.html('survame replace');
$('table.register td:nth-child(5)'.html('mail adress replace');

But this page is awful :ohmy: , look for some otimisation on 2.0

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • eschneider
  • eschneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 11 months ago #78261 by eschneider
Denis,

I agree the register page is awful. Unfortunately it appears even before the Welcome page and thus its awfulness can depress survey response just at the point when a respondent is deciding whether they really do want to respond.

The main thing we would like to do is change the verbiage on the entire page, not just the label(s) for the token. If I could force the Welcome page to appear before the register page I would not need to change very much on the register page. Failing that I would like to change the text on the register page which would make the Welcome page unnecessary. I hope that makes what are trying to do clearer.

Thanks
Ed
The topic has been locked.
More
11 years 11 months ago #78265 by Ben_V
In the source of the original register page tou can copy the code corresponding to the register form
e.g:

<form method='post' action=' yourplatform.com/register.php '>
<table class='register' summary='Registrationform'>
<tr>
<td align='right'><input type='hidden' name='sid' value='1234' id='sid' /></td>
<!-- 1234 = your survey ID -->
<td align='left'><input class='text' type='hidden' name='register_firstname' value=' ' /></td>
</tr>
<tr>
<td align='left'><input class='text' type='hidden' name='register_lastname' value=' '/></td>
</tr>....

and embed it in any basic html webpage...

Remember that you can copy, rename and adapt the register.php file in case of needed to get a custom filte to work on it:

<form method='post' action=' yourplatform.com/register_custom.php '>


Ben/

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: DenisChenu
The topic has been locked.
  • eschneider
  • eschneider's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 11 months ago #78266 by eschneider
Benitov,


Your solution appears to focus on the register page. What I'm actually trying to modify does not seem to be the register page as far as we can tell. I've called it the "authentication" page to try and distinguish it from the register page. The source which this "page" appears to generate is copied following. What generates this and how/where can I alter it (the text parts)? Thanks

<div id="wrapper"><p id="tokenmessage">This is a controlled survey. You need a valid token to participate.<br />If you have been issued a token, please enter it in the box below and click continue.</p>
<script type='text/javascript'>var focus_element='#token';</script>
<form id='tokenform' method='get' action=' npope-1718.altarum.pri/limesurvey/index.php '>
<ul>
<li>
<label for='token'>Token</label><input class='text ' id='token' type='text' name='token' /><input type='hidden' name='sid' value='91157' id='sid' />
<input type='hidden' name='lang' value='en' id='lang' /> <input type='hidden' name='newtest' value='Y' id='newtest' /></li><li>
<input class='submit' type='submit' value='Continue' />
</li>
</ul>
</form></div> </td>
</tr>
</table>
</div>
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 11 months ago #78279 by DenisChenu
You can do "what you want" with accessing the core source code.

Look at index.php :)

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
10 years 5 months ago #100442 by NetMarie
I have the same question as user eschneider.
Unfortunately I do not fully understand the suggestions that have already been made.

@eschneider: Are you still reading here? How did you solve your problem?

@everyone: How can I change the text that is shown on the same page as the token-insert field?

@DenisChenu: Where can I find index.php?

Thank you very much in advance!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 5 months ago #100460 by DenisChenu
Hi,

Updating PHP file need PHP "competence". And actually it's application/controllers/RegisterController.php

:)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose