First attempt at submitting a project for review, so if my format is off or if more info is needed, please let me know!

PrivateLink module

This module was created when the need arose to offer a downloadable file to users of a site, without revealing the actual URL of the file itself. It also allows through the permissions system a method of allowing the file to only be available for download to registered users. If enabled, anonymous users will see the same dynamic link as registered users, but when they click on it they are presented with a login dialog informing them they must register to have access to the file.

project page: http://drupal.org/sandbox/bradjmsu/1370844

git repository: git clone --branch master bradjmsu@git.drupal.org:sandbox/bradjmsu/1370844.git

Drupal 7

Comments

ethanw’s picture

Status: Needs review » Needs work

Looks like you have some coding standards issues that can be tightened up. See http://www.ventral.org/pareview/httpgitdrupalorgsandboxbradjmsu1370844git for the most recent report (you can also use that link to test your code further).

kmhanser’s picture

Ok!

I have made some formatting changes and now the code sniffer returns no errors. (I previoulsy ran it thru the Code Review module, but didn't know about the Code Sniffer -- I'll use that in the future :) )

Please review further and let me know any additional changes!

thanx!

ethanw’s picture

Looking better.

It looks like you're working on the mater branch, check out http://drupal.org/node/1127732 for instructions.

Also, can you explain how this module is different from the Core "Private" download behavior for files, e.g. http://drupal.org/documentation/modules/file? On first review, it looks like the main difference is that this module includes the ability to set and expiration period for private links, are there additional distinguishing features?

kmhanser’s picture

Yes, I need to do something with the branch (this is my first time working with git, still getting used to it ;)

As to how it's different from the private files behaviour: This module will obscure the location of the file from the end user. Basically it allows you to give links to people that they can't easily share with others. From what I understand based on my testing with private file storage, the link to the file is the same every time. We wanted a way to obscure the actual location of the file from the user (for whatever reason). Also, if someone does give the link to someone else, instead of the standard "Access Denied" or "Not Found" error that's normally given when a non-registered user tries to access a private file (I think that's what happens, correct me if I'm wrong), we redirect to a login page that informs them that they must register or login to access the content.

It's basically just a way to obscure the real location of file links with a dynamically generated one. And a little access control/redirection.

This module came about because we had a Wordpress site that's being migrated to Drupal. Some of the posts had downloadable files attached to them using the Wordpress Download Monitor plugin. The features of the download monitor that we wanted to use were:
- force user to register or login before they can download the file
- serve the file to the user using a dynamic link so the user doesn't know the actual location of the file
So we tried to write a Drupal module that would fill both these requirements (I searched for something that already did this, but didn't find something that exactly fit the bill. There were some that did some of it, like Field Permissions or a module to email download links to people, but none of them really obscured the link w/a dynamic link like we wanted.)

thx!

ethanw’s picture

Since there's a bit of a name collision between the core "Private download" feature and this module, I wonder if a rename wouldn't help. Perhaps "Expiring File Link" or "Temporary File Link" would be clearer.

kmhanser’s picture

Ok, how about "Dynamic File Link" or "Obscured File Link" or even "Private File Link" maybe to make it clear that it applies to file links only...

ethanw’s picture

I think "Dynamic", "Temporary" or "Expiring" would all be along the right line. Is "Expiring Private File Link" too long?

kmhanser’s picture

Expiring Private File Link should work. It's nice and descriptive of what it does :D

I'll work on changing the project name and the code over to that. So that would be expiring_private_file_link for my functions, eh? Gonna be some long function names -- but that's OK, nobody will have to actually type them in to use the module :D

thx!

(got placed on other projects since the initial posting, hence the delayed response.. but I'm still here and working on it!)

ethanw’s picture

Sounds great, and I certainly understand competing priorities.

Btw, this service seems interestingly related to your module: https://onetimesecret.com/

kmhanser’s picture

Ok, I have renamed the module and sandbox project to Expiring Private File Link. I've updated the module code functions and strings w/the new name appropriately.

Tested on ventral.org and things look ok except for a weird error it's giving me about my @file comments:
http://ventral.org/pareview/httpgitdrupalorgsandboxbradjmsu1370844git
Which is strange, since they look ok based on this page:
http://drupal.org/node/1354#files

Only other minor issue it's reporting is because I do most of my actual devel w/our in-house SVN repo so it's complaining about my $Id$ tag... but that doesn't really affect anything so it's a minor thing we can just ignore for now :)

Working implementation / more info can be found at: http://www.energywebdevelopment.com/node/355

Lemme know what else we need to do to get this promoted to "full module" status! :D

thx!

-kevin

kmhanser’s picture

Soooo... what do I need to do to get this module out of the sandbox and implemented as a "real" module?

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

kmhanser’s picture

... I didn't realize there was anything else that needed to be fixed on this module? It's in a working state from my understanding.

klausi’s picture

You need to set the status to "needs review" if you want to get a review. See http://drupal.org/node/532400

klausi’s picture

Issue summary: View changes

change intro text