MembersArea to protect links/files?

Erweiterungen
Post Reply
Alexandre
Posts: 5
Joined: Tue 25. Feb 2014, 09:32

MembersArea to protect links/files?

Post by Alexandre »

Hello!
I wonder if there's a way to use a MembersArea plugin to protect not the whole pages, but some links, i.e. make them visible and downloadable (or simply to require a member's login to download files) only to members?
Currently I can create the page for with links for members and the same page for non-members, but if I know the link to the file, it may be downloaded from the site without logging in. So anti-leech generally is a concern.

Thanks.
Gert
Posts: 2211
Joined: Sun 18. Nov 2012, 14:18

Re: MembersArea to protect links/files?

Post by Gert »

Alexandre wrote:I wonder if there's a way to use a MembersArea plugin to protect not the whole pages, but some links, i.e. make them visible and downloadable (or simply to require a member's login to download files) only to members?
No, MembersArea is just a Plugin to protect/hide the contents of CMSimple pages.
Alexandre wrote:... but if I know the link to the file, it may be downloaded from the site without logging in.
If you are allowed to use .htaccess, try to add a .htaccess file to the folder ./userfiles/downloads/ with following content:

Code: Select all

Order deny,allow
Deny from all
... and set the download link this way:

Code: Select all

./?download=filename.pdf
Direct access/download should be forbidden now, but the download link should work,
Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services
Alexandre
Posts: 5
Joined: Tue 25. Feb 2014, 09:32

Re: MembersArea to protect links/files?

Post by Alexandre »

Thanks for the reply.
I played with htaccess, but it didn't seem to work for me. Maybe I simply don't have the rules enabled on the web hosting.

I finally used a very weird combination of expand/collapse addon and protecteddownloads addon to hide the link - it actually does the trick - I create a subpage with a protected link, set it to be member-only accessible (using membersarea), then put and expand/collapse to a page which should contain the link - the expansion (and thus link visibility) is only available for logged in members :-)
Post Reply