- This topic has 2 replies, 2 voices, and was last updated 14 years, 6 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Protected Downloads – SOLVED
Tagged: downloads, pdf stamper, protected member downloads
I had a requirement to protect pdf documents within a protected member area. Currently eMember doesn’t allow this, it only allows protection of pages etc.
What I wanted to do was add a digital product (pdf) as a product into eStore and only allow eMember logged in users to download these pdf’s.
The main reason I wanted this was to force people to log into the site to download the pdfs and not to simply save the download url.
So, in case any one else has this requirement here is the Teak.
Navigate (using either FTP program or php editor) to the wp-content/plugins/wp-cart-for-digital-products
Open up the downloads.php file and alter as follows:
(on line 2, under <?php) add the following;
session_start();
if (!$_SESSION) exit;
Now the user will have to be logged in to download the file.
Thanks for sharing this tweak.
Not sure if this is helpful too:
Actually found that the above method was clearing out the session for some reason.
Instead find line 68 and replace with:
else
{
// Offer the product as a download
$path_parts = pathinfo($file_path);
$file_name = $path_parts;
if (isset($_SESSION[“wordpress.AUTH.eMember”])){
//custom_read3($file_path,$file_name);
if (ini_get(‘allow_url_fopen’) == ‘1’)
{
download_using_fopen($file_path,$file_name);
}
else
{
download_using_curl($file_path,$file_name);
}
}
}