Posted on by

Private Links and Setting Up the “Lost Link” Function

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>')

 

18 thoughts on “Private Links and Setting Up the “Lost Link” Function

  1. I am testing a new site. Now pdb_request_link only seems to work when I’m logged into WordPress. It stopped working from another browser in which I am not logged into WordPress. I read about a limit of requests from the same IP. Can that be the cause? All participants are colleagues with the same IP, so if there really is an IP limit, this will be a big problem. Is there a way to prevent this IP blocking?

    1. Can you be more specific about the problem you’re seeing? What happens when you try to open the private link?

      The IP restriction only applies to the login function and it only counts incorrect logins. Are you using the Participant Login plugin?

      1. Hi Roland,

        thank you for your plugin, it seems it will do properly what we need.

        I’ve got exactly the same problem as Walt.

        The log Journal says :

        “[05/05/20 8:13pm UTC]
        Participants Database Plugin: IP blocked for too many retrieval attempts from IP 90.27.231.225 in 24-hour period. ”

        But I’ve got some users that have the same IP and I need to be sure that they could retrieve their personal link to update their data.

        Is it possible to prevent this IP blocking ?

        I’ve just made a few tests so it’s very sensitive.

        1. I did not design the code to accommodate multiple users on the same IP, so you will probably need to use some custom code to make things work in that environment. There is a filter pdb-user_ip where you can add your own code to provide an identifier for the user. This filter is designed for use in situations where there is a proxy that does not pass the originating IP to the php $_SERVER[‘REMOTE_ADDR’] global. If you do have a unique identifier for each user available in the php globals, you can use that instead of the IP.

          You can also defeat checking at all with the pdb-retrieve_link_brute_force_protect filter, just return false to defeat brute force checking.

  2. Hi:
    I am not having any luck with the private link allowing me to access my record.
    When I am in my email and click on the link, it brings me to the page where to add a profile. A blank page.
    My information is not showing up.

    1. Check the “Participant Record Page” setting in the plugin settings under the “Record Form Settings” tab.

  3. Hi,
    I tried to test this resend link -option, but the email never comes thru. I did all those necessary actions in Resend Link Settings and Record Form Settings -tabs. I am using th PDb Email Templates and I was wondering if the email should be configured there? What kind of trigger should be used in that case?
    regards,
    visa jokela

    1. This function doesn’t require any configuration in the Email Templates. Are you getting the “success” message after requesting the private link? Also, be aware that repeatedly testing the same email address will fail because there are controls against abusing the form.

      1. Yes, I have got a success message, but still haven’t received any email. I have tried two different email addresses and only 2 or 3 times each.

        1. OK, but other emails from the plugin are working?

        2. I only use 4 emails sent by the Email Templates and they are working.

        3. OK, well then the most likely explanation is that the email is getting filtered by your email client as spam.

  4. Hello Roland
    I have a concern about the extension
    I would like, after recording the information by the user in the form send him in addition to the private link, the link to have access to the individual poster and then print.

    is possible? and if so, could help me do it

    cordially

    1. Yes it’s possible, you can generate a link to the single record in your email template like this:

      View your record here: Single Record Link.

      You would use your own URL for your single record page.

  5. Hi,

    The private link never comes in the initial signup, when the email comes it just shows this:

    Thank you, Echo, for signing up with SA Girls Rock Camp.

    You may complete your registration with additional information or update your information by visiting this private link at any time: .

    Just an empty spot where the link should be.
    When I go into the “signup form setting” tab I do see the blue shortcode of [record_link] in the signup response email section.

    Also, when I setup the “lost private link” option I never get the email even though on the page I get “Request your Private Link

    Success: your private link has been emailed to you.”

    Any idea what could be happening?

    1. Make sure the Participant Record Page is configured under the “Record Form Settings” tab.

      1. Hi Roland, I have started using your plugin and so far it looks like it can do everything that I want. I have a couple of things I can’t figure out though. I want people to login daily to update a field, that is working but how do I get the [record_link] field in the registration email to include the Private ID in the hyperlink? I can get it to point to the My Account page but the private_id although showing in the text is not embedded in the hyperlink. Any idea what I am doing wrong? Also is there a way of tailoring the fields displayed when the user logs in so that it only shows their name and the field I want them to update daily? Thanks (sorry it is so long winded!). AJ.

        1. The [record_link] tag should provide the complete URL to edit the record. Make sure you have the Participant Record page fully configured in the settings under the Record Form tab. It’s also possible your email template is not set up right, you need to do something like this to place the link on the clickable text:

          [record_link]

          The shortcodes have a “fields” attribute where you can determine which fields are shown…for example:

          [pdb_record fields="first_name,last_name"] 

Leave a Reply
You have to agree to the comment policy.

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.

18 thoughts on “Private Links and Setting Up the “Lost Link” Function

  1. I am testing a new site. Now pdb_request_link only seems to work when I’m logged into WordPress. It stopped working from another browser in which I am not logged into WordPress. I read about a limit of requests from the same IP. Can that be the cause? All participants are colleagues with the same IP, so if there really is an IP limit, this will be a big problem. Is there a way to prevent this IP blocking?

    1. Can you be more specific about the problem you’re seeing? What happens when you try to open the private link?

      The IP restriction only applies to the login function and it only counts incorrect logins. Are you using the Participant Login plugin?

      1. Hi Roland,

        thank you for your plugin, it seems it will do properly what we need.

        I’ve got exactly the same problem as Walt.

        The log Journal says :

        “[05/05/20 8:13pm UTC]
        Participants Database Plugin: IP blocked for too many retrieval attempts from IP 90.27.231.225 in 24-hour period. ”

        But I’ve got some users that have the same IP and I need to be sure that they could retrieve their personal link to update their data.

        Is it possible to prevent this IP blocking ?

        I’ve just made a few tests so it’s very sensitive.

        1. I did not design the code to accommodate multiple users on the same IP, so you will probably need to use some custom code to make things work in that environment. There is a filter pdb-user_ip where you can add your own code to provide an identifier for the user. This filter is designed for use in situations where there is a proxy that does not pass the originating IP to the php $_SERVER[‘REMOTE_ADDR’] global. If you do have a unique identifier for each user available in the php globals, you can use that instead of the IP.

          You can also defeat checking at all with the pdb-retrieve_link_brute_force_protect filter, just return false to defeat brute force checking.

  2. Hi:
    I am not having any luck with the private link allowing me to access my record.
    When I am in my email and click on the link, it brings me to the page where to add a profile. A blank page.
    My information is not showing up.

    1. Check the “Participant Record Page” setting in the plugin settings under the “Record Form Settings” tab.

  3. Hi,
    I tried to test this resend link -option, but the email never comes thru. I did all those necessary actions in Resend Link Settings and Record Form Settings -tabs. I am using th PDb Email Templates and I was wondering if the email should be configured there? What kind of trigger should be used in that case?
    regards,
    visa jokela

    1. This function doesn’t require any configuration in the Email Templates. Are you getting the “success” message after requesting the private link? Also, be aware that repeatedly testing the same email address will fail because there are controls against abusing the form.

      1. Yes, I have got a success message, but still haven’t received any email. I have tried two different email addresses and only 2 or 3 times each.

        1. OK, but other emails from the plugin are working?

        2. I only use 4 emails sent by the Email Templates and they are working.

        3. OK, well then the most likely explanation is that the email is getting filtered by your email client as spam.

  4. Hello Roland
    I have a concern about the extension
    I would like, after recording the information by the user in the form send him in addition to the private link, the link to have access to the individual poster and then print.

    is possible? and if so, could help me do it

    cordially

    1. Yes it’s possible, you can generate a link to the single record in your email template like this:

      View your record here: Single Record Link.

      You would use your own URL for your single record page.

  5. Hi,

    The private link never comes in the initial signup, when the email comes it just shows this:

    Thank you, Echo, for signing up with SA Girls Rock Camp.

    You may complete your registration with additional information or update your information by visiting this private link at any time: .

    Just an empty spot where the link should be.
    When I go into the “signup form setting” tab I do see the blue shortcode of [record_link] in the signup response email section.

    Also, when I setup the “lost private link” option I never get the email even though on the page I get “Request your Private Link

    Success: your private link has been emailed to you.”

    Any idea what could be happening?

    1. Make sure the Participant Record Page is configured under the “Record Form Settings” tab.

      1. Hi Roland, I have started using your plugin and so far it looks like it can do everything that I want. I have a couple of things I can’t figure out though. I want people to login daily to update a field, that is working but how do I get the [record_link] field in the registration email to include the Private ID in the hyperlink? I can get it to point to the My Account page but the private_id although showing in the text is not embedded in the hyperlink. Any idea what I am doing wrong? Also is there a way of tailoring the fields displayed when the user logs in so that it only shows their name and the field I want them to update daily? Thanks (sorry it is so long winded!). AJ.

        1. The [record_link] tag should provide the complete URL to edit the record. Make sure you have the Participant Record page fully configured in the settings under the Record Form tab. It’s also possible your email template is not set up right, you need to do something like this to place the link on the clickable text:

          [record_link]

          The shortcodes have a “fields” attribute where you can determine which fields are shown…for example:

          [pdb_record fields="first_name,last_name"] 

Leave a Reply
You have to agree to the comment policy.

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.