Closed (won't fix)
Project:
IMCE
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Jun 2008 at 10:55 UTC
Updated:
19 May 2011 at 21:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ufku commented1) IMCE does not implement file/directory protection. I don't know if there is any module for this purpose.
2) IMCE is compatible with private file system. It implements file_download hook but not any restrictions on it.
Comment #2
-Anti- commentedThanks for your reply
> 2) IMCE is compatible with private file system.
> It implements file_download hook but not any restrictions on it.
Does that mean that the 'private' attachments folder still functions
when it is enabled in Administer > Site configuration > File System,
but the directory-tree used for IMCE has no protection?
Cheers.
Comment #3
ufku commentedyes, that's right.
Comment #4
MiMe commentedSuggestion to make files protected:
This makes file access denied if the IMCE profile doesn't have browse access.
I have only made som very limited tesing.
Sorry, I don't have the ability to create a patch...
Comment #5
ggamba commentedHi Anti,
Private upload (http://drupal.org/project/private_upload ) works well for me: it creates a "private" directory under \files that works exactly as if you were in "private" mode, while the other stuff in \files works in "public" mode.
It would be great, by the way, if IMCE could interact with Private upload in some way (to upload a file in the "private" directory you have to use File attachments while editing the node, you can't use IMCE).
Bye
Gabriele
Comment #6
vacilando commentedMiMe's patch works precisely as expected -- I very much recommend IMCE to implement it to allow private files for directories that do not have IMCE browse access.
Comment #7
Skirr commentedIt would be great to have this feature. Will it be implemented?
Comment #8
ufku commentedThis patch allows IMCE to control the whole file system as if the only file uploader is IMCE in the system. This should cause inconsistency with other uploader modules. There must a yes/no setting to make administrators decide to give the whole control to IMCE.
Comment #9
kassissieh commentedIs #8 true? Module_invoke_all causes all site modules to run hook_file_download on the requested file path. If a module returns -1, then the download is denied, no matter what other modules return. For example, if a user uploads a file to the file system using CCK and a node access module, then CCK's prohibition of download would take precedence over IMCE allowing the download. It's only in the case that other upload modules return no result that IMCE would allow access to such a file. However, this leads to a different kind of problem when IMCE is uninstalled. I'll file a separate feature request about that.
The patch in #4 sounds like a good improvement.
Comment #10
izmeez commentedsubscribing
Comment #11
vitis commentedsub
Comment #12
fajo commentedThe changes suggested in #4 will cause IMCE to take responsibility over ALL files and not only files in directories configured in the IMCE profiles. That is, if a directrory is not configured in IMCE the hook will deny access to that file. Attached a patch against 6.x-1.4 that will fix this. It is a slightly modified verion of #4's changes that will ignore files in directories not configured in the users IMCE profile. Below is the code:
Comment #13
MiMe commentedThe line:
require_once 'inc/page.inc';
Should be replace by this:
module_load_include('inc', 'imce', 'inc/page.inc');
Otherwise filefield_sources will generate an error when you have applied the upload patch #877452: Enable uploading and deletion through IMCE
Comment #14
MiMe commentedSorry, my bad...
the module_load_include should look like this:
Comment #15
Anonymous (not verified) commentedI hacked the code with
but when I login I got following errors:
* You do not have access to any configuration profile to use the file browser!
* warning: Invalid argument supplied for foreach() in /var/www/vhosts/snowpedia.it/httpdocs/sites/all/modules/imce/inc/imce.page.inc on line 907.
Comment #16
MiMe commentedWhat version of IMCE are you using?
Comment #17
Anonymous (not verified) commentedIMCE 6.x-2.x-dev (2010-ott-06)
Comment #18
MiMe commentedI've updated the code to include the $serve variable from the current IMCE and also to check if the $imce['directories'] is empty.
giorez: Try this code.
Comment #19
ufku commentedClosing 6.x-1.x issues as this branch is no more supported.