News:

Wondering if this will always be free?  See why free is better.

Main Menu

No Download Attachment

Started by bolubeyi61, March 31, 2013, 02:32:47 PM

Previous topic - Next topic

bolubeyi61

Link to Mod

Guest not allowed to download attachment. Please login or register.

Screenshot






Demo:
Click
User: demo pass: demo

License:

No Download Attachment by Guest No Download Attachment is licensed under a Creative Commons Attribution 3.0 Unported License.
Linkteki çalışma baz alınarak yapılmıştır http://custom.simplemachines.org/mods/index.php?mod=3662.

Arantor

I'm confused by the code here.

There's a branch in the template for if the user is a guest, but then a whole branch for whether the user can approve it or not. Guests cannot ever approve items (there is physically no option in the permissions area for this), and even if by some fluke they ever managed to get permission (by manual database editing), they wouldn't be able to approve it anyway.

The entire branch then about unapproved attachments could just be removed from the is-guest section of code.

More curiously, there is a security issue with this modification. Since it requires view-attachments permission to get the attachment data, and then you're just hiding attachments from being shown to guests, should a guest ever figure out the attachment id, they will be able to download it. This means someone could share a link to an attachment and you'd have no way to stop guests downloading it.

NanoSector

The code confused me too, but it works to a degree and looked "okay". I'd be willing to take a second look at it.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

bolubeyi61

only works on the first message. thanks.

Arvacon

Hi.
I tried your mod at my local wamp installation and it works fine, but then I tried use it at my live forum and it doesn't seems to work.
What could be wrong? I don't get any errors at the log file. It just doesn't react at all at my forum, guests can see the attachments as usual, with or without the mod.
Any solution to make it work?

kamili34

Polish utf-8 translation

$txt['no_download_attachment'] = 'Nie możesz pobrać załącznika.';

Advertisement: