Coming January 2009 - version 2.4 of the LinkLocker Module. It has been coded and I’m finishing up testing. One of the most noticeable improvements is that LinkLocker will no longer require allow_url_fopen to be set in the php.ini file. Now, if it is not set, the module will attempt to use curl() functions to get the file.
I’ve also added a new parameter to the tag: path. With this, you may simply specify the path to the file (relative to the site root) instead of a url. This is now the recommended way of using the module if the files are maintained on the same server as the site, as it avoids any issues with allow_url_fopen, curl overhead, or .htaccess complications.
Thanks to all of you who have made great suggestions for improving this module.
Happy Holidays!
Brad
Brad,
I am looking forward to 2.4. In the meantime I am having some issues with 2.2. I had to move my client’s site to a new server and in the move have encountered a couple of issues. I ended up removing and reinstalling LinkLocker to restore the function. It now correctly hides the file location, but when I click on the file to download the browser opens another window and nothing further happens. The file does not download as expected.
Any assistance you can provide will be greatly appreciated.
thanks.
I cannot get two parameters to work correctly: restricted_groups and restricted_url.
I’m embedding my link inside an exp:query tag, and passing it a couple parameters - which works perfectly fine as long as I’m not using those two parameters. Here is an example of how I’m using it (this is simplified and stripped-down for the example):
<table id="transactions" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Item</th>
<th>Purchase Date</th>
<th>Download</th>
</tr>
{exp:query sql="SELECT fields FROM table WHERE condition"}
<tr {switch="|class='alt'"}>
<td><a href="/path-to/docs/{q_url_title}/" title="Read Docs">{q_entry_title}</a></td>
<td>{q_purchase_date format="%Y-%m-%d"}</td>
<td>{embed="group/_file" file="{q_file}" label="{q_url_title}"}</td>
</tr>
{/exp:query}
</table>
Then in the embed I have this:
<a href="http://{exp:linklocker">Download</a>
That works perfectly fine. I’d prefer to have a little more protection, must to make sure that only members from the right groups have access, however, the following does not work:
<a href="http://{exp:linklocker">Download</a>
The minute I add those, the URLs always show as the restricted URLs, whether I’m logged in as a super admin, or logged in as a member of group 7. This isn’t a dealbreaker for how I’m using Linklocker right now, but I would like to know why those two parameters are not working when I try to use them.
Any thoughts? Am I missing something obvious?
I tried changing to restricted level, but that doesn’t seem to do anything. Now it seems that the restricted_url isn’t being seen - I can download the file no matter what user group is in the restricted_level parameter. I’m logged in as group 7 user for testing, and have changed restricted_level to ‘9’ as well as ‘1|7’ and ‘7’ and in every case I can still download the file.
Thanks for looking into this.
Found it - line 121 of mod.linklocker.php should read as follows:
if (count($this->restricted_level) AND !(in_array($SESS->userdata['group_id'],$this->restricted_level)))
instead of
if (count($this->restricted_level) AND !(in_array($SESS->userdata['group_id'],$restricted_level)))
LinkLocker version 2.4 has now been released. As of this version, allow_url_fopen is no longer required. If this setting is off, the module will attempt to use curl functions to send the file. Even better, a url is no longer required as the module will now accept a parameter of “path” - a path, relative to the root of the site, to the file you wish to allow access to. Also, I fixed the bug with “restricted_groups” that Ryan noted above. Thanks to everyone who has purchased this module.
If you’d like to purchase, PM me and I will send you my paypal address. License is $30 USD per site.
Ryan - will send you the updated version - simply replace your files with these, then click on LinkLocker in your “Modules” section - will upgrade automatically. I didn’t send this to you yet because you were testing Digital Commerce, and it is not compatible with this version. Will send you the updated module and the line that would need to change in Digital Commerce in order to make this work with it when I return home this evening - don’t have access to anything from here.
Thanks again!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.