I found your module and it looked like exactly what I need except I needed it to work for 3 different folders, each accessible to one role. So, in looking through other comments on this module, I copied the module into 3 folders and renamed them to
private_download_documentation
private_download_internal
private_download_policy
Then I had to modify all of the functions to have these names instead of just private_download so there weren't name collisions for the functions. It appeared to work great but now although it protects the folders, I can't download the file. I will attach one of the .htaccess files and can attach one of the modified modules as well if that would be useful

CommentFileSizeAuthor
htaccess.zip237 bytessher1

Comments

johnhanley’s picture

Status: Active » Closed (duplicate)

Multiple private directory strategies have been discussed in other issues. However, I don't think anyone has posted a definitive solution.

In any event, I'm closing this issue due to inactivity. Please reopen or create a new issue if you or someone makes any progress regarding it.

dunwich42’s picture

Hi,
Well I'm having a go at getting this to work for multiple folders.
As suggested above I renamed all the functions.
I also renamed the access argument (once in "private_download_perm" and once in "private_download_menu"). Setting it up works fine & everything looks good, but the security seems to be using the first version of "private_download".

Any ideas? or pointers to the other issues discussing this (I've searched & couldn't find any applicable ones).

Thanks,
Darren.

dunwich42’s picture

Status: Closed (duplicate) » Active
dunwich42’s picture

Ok, so I did get it working & here were the steps.

I made a copy of the private_download module folder, renaming all files & basically doing a search & replace inside the files.
In my case I changed it to private_download_2.

Then I changed the access argument. Once in "private_download_2_perm()" and once in "private_download_2_menu()".
I'm not sure if it matters but at one point I suspected just adding "2" on the end didn't work so in the end I changed it by more than just adding "2" - to 'access free resources download directory'.

The final step was to hard code the folder. I'm not quite sure why this was required but it didn't work before & it does now.
In "private_download_2_menu()", I hard coded the $items path i.e. "$items['system/files/freeresources'] = array(", and also the page arguments i.e. "'page arguments' => array('freeresources'),".

The final change seemed to match up with the original post this module was based on.

Darren.

joegl’s picture

Issue summary: View changes

I had to do this and can vouch for most of the people above me.

I renamed all functions, files names, etc., from private_download to private_download_second_location.

The other big thing is access permissions for the following functions.

private_download_perm()

private_download_file_download()

There is just one line for the perm function. I changed the access permission to 'access second private download directory'. Then for the file_download function there are two lines with user_access() in them; that's where you'd update the permissions.

Sorry I couldn't be more detailed but I'm writing this at work.

johnhanley’s picture

Status: Active » Closed (won't fix)

Closing due to Drupal 6 end-of-life cycle.