phpBB Digests

Not authorized to download attachments via digest link - phpBB Digests

Not authorized to download attachments via digest link

New postby thetobster » Mon Dec 05, 2011 4:50 pm

When a user attaches a file the link comes through in my digest. I was able to fix the invalid link that was being sent by changing the "Force server URL settings" option from NO to YES as per another post. However, I'm still having a problem where the link although technically valid doesn't work. When the user clicks it they are redirected to a page and given the message "You are not authorised to download this attachment." This even occurs if the user is already logged in (for example in another tab). I've attached a screen shot to give you a better idea.

I suspect the problem might have to do with the link in the digest missing a session ID. An example of the link that is included in the digest is: http://msih.net/forum/download/file.php?id=24

If the user proceeds to click login then they lose the link and have to navigate all the way through the forum to find the file again...

Does anybody know a workaround? Hopefully this was a good description of the problem, I'm not an expert in phpBB or digests by any means!
Attachments
Screen Shot 2011-12-05 at 6.43.02 PM.png
thetobster
Registered User
 
Posts: 12
Joined: Mon Apr 19, 2010 2:13 am

Re: Not authorized to download attachments via digest link

New postby thetobster » Mon Dec 05, 2011 5:14 pm

As an added note, I partially solved the problem. It seemed that my cookie settings were incorrect and therefore not allowing the links to work for users who were already logged in.

However, it's still a bit awkward for a user who isn't logged in in that they get the "You are not authorized..." message instead of a prompt for username/pass as is the behavior for if you click on a post.

Thanks!
thetobster
Registered User
 
Posts: 12
Joined: Mon Apr 19, 2010 2:13 am

Re: Not authorized to download attachments via digest link

New postby MarkDHamill » Mon Dec 05, 2011 5:56 pm

The problem may be that you have enabled secure downloads. I would check your settings in the ACP, Attachment settings and see if there are conflicts there, like IP blocking. You might want to review the logic in the function download_allowed in /downloads/file.php because it is likely triggered by this logic.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA

Re: Not authorized to download attachments via digest link

New postby thetobster » Tue Dec 06, 2011 4:25 pm

Everything is working so long as the user is logged in first. I checked and secure downloads are not enabled. I'll have to run through the logic in /file.php but just to clarify what I'm asking, do you think it's possible that phPBB would prompt the user to login (assuming they're not already) instead of just throwing up a not authorized message?
thetobster
Registered User
 
Posts: 12
Joined: Mon Apr 19, 2010 2:13 am

Re: Not authorized to download attachments via digest link

New postby MarkDHamill » Tue Dec 06, 2011 5:12 pm

That may be what's happening. If it is, you might want to submit a feature request.

Odd no one else has had this problem, or at least bothered to report it.
Get the latest versions of my Digests and Smartfeed mods.
MarkDHamill
Registered User
 
Posts: 2117
Joined: Fri Aug 02, 2002 12:36 am
Location: Oak Hill, Virginia USA