[openupload-devel] New Plugin: groupfiles
Status: Beta
Brought to you by:
tsdogs
|
From: Jochen D. <jo...@co...> - 2009-05-24 09:42:15
|
Hey Alessandro, Here is the second plugin I've created. This one provides access to a file for a whole group. When the plugin is enabled for a certain user, this user can select one or more groups that can have access to the file. Users in said groups will see that file in their file list can see the details and download the file. The plugin implements the fileList, uploadOptions, uploadConfirm and fileDetails actions. I have made some changes to files.inc.php, more specifically in fileList and fileDetails: fileList: the plugin gets an array in which count, rows, offset and the file list are passed. In the same array, the additional file list from the plugin and the total number of additional files from the plugin are passed back through the same array. This way the file list can be reconstructed with the files from the plugins appended to the original file list. Pagination should continue to work. fileDetails: the plugin can manipulate the finfo array, before access to the file details are checked. This was done specifically to allow the groupfiles plugin to let the user see files that are not his, but visible to his group. Ther might be a more elegant way to do this, but I couldn't immediately find one. Furthermore, the file options can be manipulated by the plugins and the fileDetails method will save them back to the database. This allows plugins to alter the file_options even after the file has been uploaded (which I think would be a good overall feature). I might have overstepped some design philosophies you had for OpenUpload to implement this plugin, let me know how it works out for you. As always, I'm happy to make changes to let it fit better with what you had in mind. enjoy jochen |