Fieldtype, Module

Archived
Forum
(read-only)

Protected Links

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Yuri Salimovskiy

     

IP Address Not Allowed - Guest Access set to Yes

Support Request

Boyink
Boyink

Hi -

I have this code:

{exp:protected_links:generate url=”{ebook_download_link}” guest_access=“yes” title=“Download {title} Now!”}

It generates the following error for non logged-in users:
Your IP address can not access this file

If I’m logged in then the generated link works fine.

Yuri Salimovskiy
# 1
Developer
Yuri Salimovskiy

You probably had once generated thins link with other parameters (IP lock on, or access to members only), so system remembers it.

To force re-generation, add new_link=“yes” parameter

Boyink
# 2
Boyink

Ah ok.  I’ll give that a go - thanks!

Boyink
# 3
Boyink

Hi Yuri -

After adding that parameter it worked for me in a non-logged-in browser, but I had an email this morning that a customer was still getting the error referenced above.

Yuri Salimovskiy
# 4
Developer
Yuri Salimovskiy

Hm.
Did you keep the new_link=“yes” parameter or removed after testing yourself?
I suggest that you keep it for some time, to make sure everyone will get their links re-generated (because frontend-generated links are created for each visitor separately)
Or maybe the customer has used old link (cached, or saved on his computer)

Boyink
# 5
Boyink

I left the parameter in, and this was a new customer.  I also just double-checked that there is no caching going on at either the tag or template level.

Yuri Salimovskiy
# 6
Developer
Yuri Salimovskiy

Ok, looks like I have sort of fail in logic here… try replacing on line 84 of mod.protected_links.php

if ($q->row('bind_ip')!='' && $q->row('bind_ip')!=$this->EE->input->ip_address

with

if ($q->row('bind_ip')!='' && $q->row('bind_ip')!=$this->EE->input->ip_address && $q->row('guest_access')=='n'

The new_link=“yes” parameter will probably be not necessary anymore

I’ll also add this to next release

Boyink
# 7
Boyink

Hmm..

Line 84 already had that code?

Yuri Salimovskiy
# 8
Developer
Yuri Salimovskiy

notice added && $q->row(‘guest_access’)==‘n’

Boyink
# 9
Boyink

Yes-it was all there exactly as the line you wanted me to update it to.

Yuri Salimovskiy
# 10
Developer
Yuri Salimovskiy

Hm. What version do you use? The latest is 1.9.1 (but still needs this line to be modified)

Boyink
# 11
Boyink

My bad - when I looked at the version I downloaded the updated code is not there.  I’m working on a slow connection - must have been successful at pasting the update in when I thought I wasn’t.

Sorry about that!

Yuri Salimovskiy
# 12
Developer
Yuri Salimovskiy

No problem. So is all working fine now?

Boyink
# 13
Boyink

So far so good…will see if I hear complaints from customers..;)