Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

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

How do I change the page requesting a token for authentication? (copied) 2 years 5 months ago #77979

  • eschneider
  • eschneider's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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.
Attachments:
The administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78001

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5324
  • Thank you received: 294
  • Karma: 249
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78049

  • eschneider
  • eschneider's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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 administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78077

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6277
  • Thank you received: 802
  • Karma: 241
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:
$(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);
   }
 
});
The administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78134

  • eschneider
  • eschneider's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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 administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78230

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6277
  • Thank you received: 802
  • Karma: 241
Hello,

I don't have a look at register HTML,

But something like
$('.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
The administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78261

  • eschneider
  • eschneider's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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 administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78265

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1069
  • Thank you received: 236
  • Karma: 74
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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78266

  • eschneider
  • eschneider's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
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 administrator has disabled public write access.

Re: How do I change the page requesting a token for authentication? (copied) 2 years 4 months ago #78279

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6277
  • Thank you received: 802
  • Karma: 241
You can do "what you want" with accessing the core source code.

Look at index.php :)

Denis
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.152 seconds
Donation Image