Closed (duplicate)
Project:
OG Files
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2008 at 03:10 UTC
Updated:
1 Mar 2008 at 09:26 UTC
I spend today testing og_files module. I must admit that I very like idea of giving groups file repository. The only problem is lots of bugs in this module ;)
For now I think that I found 2 bugs in og_files_file_download function. Here is modified code for this finction:
function og_files_file_download($file) {
global $user;
// Should only check files from 'og_files' dir. This is needed when drupal file system is
// set to private then accessing files from /files dir is not possible because this function
// returns -1.
if (strpos($file, '/og_files/') === FALSE)
return;
// f.filepath = '%d' should be f.filepath = '%s'
if(($user->uid != 1) && !db_result(db_query("SELECT o.uid FROM {og_uid} o, {files} f WHERE f.filepath = '%s' AND f.nid = o.nid AND o.uid = '%d' LIMIT 1",$file,$user->uid))) {
return -1;
}
}
Can somebody check are this changes worth of something?
Comments
Comment #1
nath commentedYes, that code fixes the bug. Should get in as soon as possible.
Comment #2
pivica commentedThanks nath. Can you please check http://drupal.org/node/212572 I have created patch that fix this 2 and 3 new bugs that I found today. With all corrected bugs it seems that og_files is ready for daily use, at least on my local comp ;)
Comment #3
pivica commentedComment #4
pivica commented