Page 1 of 1
Downlod for registered users only
Posted: 23 Aug 2012, 13:22
by ppppokerface
I have some files to download only for my registered users.
I put the download link into an article with the editor plugin.
How can I set the following steps:
- Guest user click on the download link
- Guest user need to login (with popup or redirect)
- After the login the user redirected back to the article and the download starts automatically
The currest steps are: click, redirect to login, login, the download starts automatically but the user is not redirected to the original site, he stay on the login screen and this is not too good
Thank you for your help
Re: Downlod for registered users only
Posted: 27 Aug 2012, 21:39
by Jan
Hi, for this you need to customize the component, but it cannot be set automatically, as component is not able to know (in system way) from which article it was accessed
Try to search "redirect" strings in download component and see similar posts in this forum where you can get useful information.
Jan
Re: Downlod for registered users only
Posted: 28 Aug 2012, 05:54
by mjriding
Interesting ... I have the EXACT same need/request. When a user has to log in, it only makes sense to redirect them back to the previous page where it then starts the download. Is that now how all other download systems work (outside Joomla).
Here's what I'm trying to do to make this happen, but I'm not finding all the right places to put code:
When a file is requested:
- store ID of file in session
- store curent URL in session (so I know were to redirect to)
- if the user must login, when they login, I must modify the login page to look for that session variable and change the redirect value to the stored URL
- When the user logs, the redirect goes back to the original page (from the session var)
- When the page loads, I check to see if a file dowload had been requested and if so the download is started by redirecting to the download URL.
anyway, I know this will work but I've no been able to get this all in place. This is something we could almost certainly create as a plugin but I've been unable to get it working quite right. If anyone gets this working ... or if I get the plugin created ... please share!
Thanks,
Mike