Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-07-02 14:52:41

giampablo
Member
From: Italy
Registered: 2008-07-17
Posts: 86
Website

How to give limited access to file downloads based on file categories?

Say you have a website for a school with several courses.
Students who have attended the course X can only download files belonging to the category X; students attending Y can only download files from the category Y… and so on.
I would like to create a section with limited access, using a different password based on the relevant attended course (or something similar).
Every password should show you just the list of files pertaining to a certain category.

It’s possible?
Any suggestions?

Offline

#2 2015-07-02 16:48:09

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: How to give limited access to file downloads based on file categories?

It can be done if you register students to txp and then use the rvm_privileged plugin which could only make the content accessible to them.

I am not sure though if the downloads can be reached to people who locate their URIs.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2015-07-03 11:08:03

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: How to give limited access to file downloads based on file categories?

You can use the smd_access_keys plugin to generate unique download links. For example, a file download list can be generated using a specific category:

<txp:file_download_list category='<txp:category />' form="files" sort="description" wraptag="ul" break="li" limit="99" />

and the form “files” would make tokenized links, like so:

<txp:variable name="key">
   <txp:smd_access_key url='<txp:file_download_link />' trigger="file_download" />
</txp:variable>
<p><a href="<txp:variable name='key' />"><txp:file_download_name title="1" /> [<txp:file_download_size format="auto" decimals="1" />]</a><br /><txp:file_download_description /></p>

Then, access to the files would only possible via the secured links in the password-protected sections.

Last edited by ax (2015-07-03 11:09:07)

Offline

#4 2015-07-03 11:48:48

giampablo
Member
From: Italy
Registered: 2008-07-17
Posts: 86
Website

Re: How to give limited access to file downloads based on file categories?

Hello ax,
Your suggestion sounds promising.
I am going to study the plugin and give it a try.

Thanks to all
P.S. Textpattern (and the community) never let you down

Offline

Board footer

Powered by FluxBB