The Participants Database plugin uses that I call a “private link” to allow front-end users secure access to a record in the plugin database. The private link relies on a five-character alphanumeric code to identify the record to access. I discuss the security of this method in the FAQ, but suffice to say it is secure enough for the kind of information the plugin is designed to handle.
Occasionally, a user will not be able to find their private link, so it’s nice to be able to let them get it again…this is how we do that.
Letting Your Users Retrieve their Private Link
To set this up, you need to visit the “Resend Link Settings” tab in the plugin settings. Simply enable the functionality and make sure the settings are right for your application. Most of the time, the email address will be the best choice for the ID field because it will in most cases be unique. You can choose a different field for this, but it really has to be a unique identifier.
In any case, the record must have a designated primary email address so the plugin knows where to send the email. Again, the security of this method is based on the widely-held assumption that an email address is a good way to ensure that only the intended recipient will get the private link.
That’s all there is to it…unless…
Use with a Custom Signup Template
If you are using a custom signup template that was created before version 1.5, you will need to add the function that places the “lost link” link.
For instance, in the pre-1.5 default template the submit button was set in the template like this:
<tr> <td colspan="2" class="submit-buttons"> <?php $this->print_submit_button('button-primary'); // you can specify a class for the button ?> </td> </tr>
The new template adds the link like this, so you just need to replace the old code with the new code…unless you did something different with the HTML, in which case you should be able to figure it out. It’s not complicated, just place the $this->print_retrieve_link() where you want your link to show up.
<tr> <td class="submit-buttons"> <?php $this->print_submit_button('button-primary'); // you can specify a class for the button ?> </td> <td class="submit-buttons"> <?php $this->print_retrieve_link(); // this only prints if enabled in the settings ?> </td> </tr>
By the way, that function can take arguments so you can customize it in the template rather than use the global settings:
print_retrieve_link($linktext = '', $open_tag = '<span class="pdb-retrieve-link">', $close_tag = '</span>')