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
| Comment | File | Size | Author |
|---|---|---|---|
| htaccess.zip | 237 bytes | sher1 |
Comments
Comment #1
johnhanley commentedMultiple 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.
Comment #2
dunwich42 commentedHi,
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.
Comment #3
dunwich42 commentedComment #4
dunwich42 commentedOk, 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.
Comment #5
joegl commentedI 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.
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.
Comment #6
johnhanley commentedClosing due to Drupal 6 end-of-life cycle.