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

 

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

  1. I hadn’t thought of that…another way to get this done is to look at the HTML source of the page where your search results are to be displayed, at the top of the wrapper for the list display, you’ll see the div tag that wraps the whole list display. In that tag is the instance number, that will be your target_instance value.

    HTML source for a list display

  2. The method seems to have changed since I first implemented this. I was looking for instructions on how to get the target_instance number for [pdb_search]

    The method I used is a 2 step one.
    Search on email and get the record ID.
    pdb_search target_instance=2 search_fields=”email”] (enter email address or key field)

    Output is here (ie the same page which needs the target_instance)
    [pdb_list fields='first_name,last_name,id' suppress="true"]

    [pdb_request_link] (enter the Record ID here)
    Get sent an email with the link. Job done!

    1. I use the lookup email to get the record ID as I can have more than one record with the same email address.eg children registered under the parent’s email

      If you set the Lost Private Link ID Field to email in Settings you can avoid this for instances of a single email.

      if you are using the Generate Member ID plugin you can use the member number instead.

      Can I add the recapture to this method?

      1. It is currently not possible to add a captcha field to the link recovery form…good idea, though, I’ll look into it.

  3. hello! the resend link function is not working for me. when testing, we have it set as ‘same page’ which is on our home page, and when we click the button that the private link was forgotten and need it resent, it takes us to a blank page with nothing on it. We also tried setting it to “home” page and again after its clicked, it redirects us to a blank page. then we went ahead and made a page titled “recover your link” and had it sent there and that page doesn’t display anything as far as entering your email to recover your private link, again it is blank. In a previous test on another site, I believe there was just a pop up that appeared with the option to enter your email to get an email with your link, but on my new site im working on, its not working at all. any troubleshooting or suggestions you can help out with?

    another thing that doesnt really have to do with this is that once we “sign up”, it directs to the thank you page which just displays the short code (the actual code) and not what the short code should be saying…. then if you go back to the home page, instead of the sign up form, the thank you page short code is now in place of the sign up form….. very confusing. Any ideas?

    1. Blank page indicates a serious error of some kind, so that is the first thing to deal with. You’ll need to set up your php error log to see what is coming in to the log when you use this feature. Without knowing why it’s not working in this case, I can’t be specific about how to solve it.

      If you don’t know how to set up your php error log, you can ask your web hosting service to set it up for you.

  4. Thank you for your plugin. I got it works, but have a question hope you can help:

    Beside getting the private link for the user to edit record, is it possible to put a menu item (a custom link in the menu) for the logged in user to directly go to the private link. This way the user do not separately bookmark the link and look for it outside the wordpress website (of course after logged out, the menu is gone).

    Logically after the user logged in, the private link should be come up and ready to access. Any suggest do you have to make it possible?

    Thank you in advance!

    1. It is possible to add dynamic values to WordPress menus, I forget the exact process, but you can look it up. You will need to set up a way to link a logged in user to a particular record. Take a look at this article for some ideas on how to do that:

      Using Participants Database with WP Users

  5. Hi,

    I would like to know, is it true that anyone having a private link (or spamming a private link) might get access to a participant’s record? or after entering the link, he or she still have to login in order to access the record?

    Thanks,

    1. The private link is all the user needs to gain access to edit a record. Anyone who possesses the link can use it, so it should be kept private. If you want the user to be logged in, then you can place the [pdb_record] shortcode on a page that requires the user to log in.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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

Your email address will not be published. Required fields are marked *

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

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

  1. I hadn’t thought of that…another way to get this done is to look at the HTML source of the page where your search results are to be displayed, at the top of the wrapper for the list display, you’ll see the div tag that wraps the whole list display. In that tag is the instance number, that will be your target_instance value.

    HTML source for a list display

  2. The method seems to have changed since I first implemented this. I was looking for instructions on how to get the target_instance number for [pdb_search]

    The method I used is a 2 step one.
    Search on email and get the record ID.
    pdb_search target_instance=2 search_fields=”email”] (enter email address or key field)

    Output is here (ie the same page which needs the target_instance)
    [pdb_list fields='first_name,last_name,id' suppress="true"]

    [pdb_request_link] (enter the Record ID here)
    Get sent an email with the link. Job done!

    1. I use the lookup email to get the record ID as I can have more than one record with the same email address.eg children registered under the parent’s email

      If you set the Lost Private Link ID Field to email in Settings you can avoid this for instances of a single email.

      if you are using the Generate Member ID plugin you can use the member number instead.

      Can I add the recapture to this method?

      1. It is currently not possible to add a captcha field to the link recovery form…good idea, though, I’ll look into it.

  3. hello! the resend link function is not working for me. when testing, we have it set as ‘same page’ which is on our home page, and when we click the button that the private link was forgotten and need it resent, it takes us to a blank page with nothing on it. We also tried setting it to “home” page and again after its clicked, it redirects us to a blank page. then we went ahead and made a page titled “recover your link” and had it sent there and that page doesn’t display anything as far as entering your email to recover your private link, again it is blank. In a previous test on another site, I believe there was just a pop up that appeared with the option to enter your email to get an email with your link, but on my new site im working on, its not working at all. any troubleshooting or suggestions you can help out with?

    another thing that doesnt really have to do with this is that once we “sign up”, it directs to the thank you page which just displays the short code (the actual code) and not what the short code should be saying…. then if you go back to the home page, instead of the sign up form, the thank you page short code is now in place of the sign up form….. very confusing. Any ideas?

    1. Blank page indicates a serious error of some kind, so that is the first thing to deal with. You’ll need to set up your php error log to see what is coming in to the log when you use this feature. Without knowing why it’s not working in this case, I can’t be specific about how to solve it.

      If you don’t know how to set up your php error log, you can ask your web hosting service to set it up for you.

  4. Thank you for your plugin. I got it works, but have a question hope you can help:

    Beside getting the private link for the user to edit record, is it possible to put a menu item (a custom link in the menu) for the logged in user to directly go to the private link. This way the user do not separately bookmark the link and look for it outside the wordpress website (of course after logged out, the menu is gone).

    Logically after the user logged in, the private link should be come up and ready to access. Any suggest do you have to make it possible?

    Thank you in advance!

    1. It is possible to add dynamic values to WordPress menus, I forget the exact process, but you can look it up. You will need to set up a way to link a logged in user to a particular record. Take a look at this article for some ideas on how to do that:

      Using Participants Database with WP Users

  5. Hi,

    I would like to know, is it true that anyone having a private link (or spamming a private link) might get access to a participant’s record? or after entering the link, he or she still have to login in order to access the record?

    Thanks,

    1. The private link is all the user needs to gain access to edit a record. Anyone who possesses the link can use it, so it should be kept private. If you want the user to be logged in, then you can place the [pdb_record] shortcode on a page that requires the user to log in.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

  10. 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

Your email address will not be published. Required fields are marked *

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