Cleanup file upload handling some more.
I added some new config options to allow you to set thresholds for project file uploading and bug file uploading.
I added a config option to control whether reporters can always add files to their own bugs.
I added two new file_api functions that can be called to check whether a user can upload a file. It takes into account access thresholds, whether file uploading is enabled, etc. These functions should be used everywhere in the code... if they're inadequate we can improve them.
-
bug_file_add.php
use new file_api functions for file upload access check
-
bug_file_upload_inc.php
check if we can upload (using new file_api functions) and return if not (don't error, that's not very useful)
-
bug_report.php
use new file_api functions for file upload access check
-
bug_report_advanced_page.php
use new file_api functions for file upload access check
-
bug_report_page.php
use new file_api functions for file upload access check
-
bug_view_advanced_page.php
use new file_api functions and seperate checks for viewing attachments from checks for uploading new ones
-
bug_view_page.php
use new file_api functions and seperate checks for viewing attachments from checks for uploading new ones
-
config_defaults_inc.php
(g_upload_project_file_threshold): new option controlling the access level needed to upload project files
(g_upload_bug_file_threshold): new option controlling the access level needed to upload files attached to a bug
(g_allow_reporter_upload): new option that allows reporters to upload files to their reported bugs even if their access level is lower than that specified by the above option
-
proj_doc_add.php
use new file_api functions for file upload access check
-
proj_doc_add_page.php
use new file_api functions for file upload access check
-
core/file_api.php
(file_allow_project_upload): new function that determines whether a user can upload a file to thegiven project
(file_allow_bug_upload): new function that determines whether a user can upload a file to the given bug (or to a new bug in the current project)
-
core/html_api.php
(print_doc_menu): use new file_api functions to determined whether to display the "Add File" link
-
doc/ChangeLog
add comments about new config options
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1669 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |