Closed (fixed)
Project:
Private
Version:
5.x-1.0
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
25 Jan 2007 at 21:39 UTC
Updated:
27 Oct 2008 at 16:21 UTC
A hook for not displaying file upload (node & comment) for private content :
/**
* Implementation of hook_file_download().
*/
function private_file_download($file) {
$file = file_create_path($file);
$result = db_query("SELECT f.* FROM {files} f WHERE filepath = '%s'", $file);
if ($file = db_fetch_object($result)) {
$node = node_load($file->nid);
if ($node->private == 1) {
if (node_access('view', $node) == FALSE) {
return -1;
}
}
}
}
Comments
Comment #1
gregglesThis was added in http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/private/pri...
Thanks, lilou!
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.