Quantcast
Channel: Topics in Category: Can I do this with LimeSurvey? - LimeSurvey forums
Viewing all articles
Browse latest Browse all 17529

Can I pass user token into url after registration? - by: Pandar

$
0
0
Hey! I've done this. I editted this file:
application/controllers/RegisterControllers.php
• Go to the public function getTokenId($iSurveyId).
• At the end of this function is a line where $sMailMessage can be replaced.

$this->sMailMessage= "<div id='wrapper' class='message tokenmessage'>"
. "<p>".gT("Thank you for registering to participate in this ballot.")."</p>\n"
. "<p>".gT("An email has been sent to the address you provided with an access link to this ballot.")."</p>\n"

//You can either replace, add or comment out what you don't need, but this is where you would insert something like this:

. "<p>".gT("Click Here to Proceed:")."<a href=' www.yoururl.com/index.php/12345/lang/en/token/$oToken- >token'>"."Access Survey Here."."</a></p>"
. "<p>".sprintf(gT("Survey administrator %s (%s)"),$aSurveyInfo,$aSurveyInfo)."</p>"
. "</div>\n";


return $oToken->tid;

}
}

The $oToken->tid was the clue. I set the message to display this and it showed me the ID from the database. Then I realized $oToken is an object. All I had to do was find the variable containing the token values. Scrolling up, I found $oToken->token and gave that a try. I think this will only work within this php file though.

Is this what you were looking for? PS. if this works for you after you edit your files, be sure to run backups in case your updates are automatic.

Viewing all articles
Browse latest Browse all 17529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>