Skip to content

Commit

Permalink
Fixed edit bugnote to allow the correct users to edit and update.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@926 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed May 8, 2002
1 parent 9c098fd commit 0947703
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bugnote_edit_page.php
Expand Up @@ -15,11 +15,11 @@
project_access_check( $f_id );

# make sure the user accessing the note is valid and has proper access
$t_reporter_id = get_bug_field( $f_id, "reporter_id" );
$t_bugnote_user_id = get_bugnote_field( $f_bugnote_id, "reporter_id" );
$t_user_id = get_current_user_field( "id" );
if ( get_bug_field( $f_id, "status" ) < RESOLVED ) {
if (( access_level_check_greater_or_equal( ADMINISTRATOR ) ) ||
( $t_reporter_id == $t_user_id )) {
( $t_bugnote_user_id == $t_user_id )) {
# do nothing
} else {
print_header_redirect( $g_logout_page );
Expand Down
11 changes: 11 additions & 0 deletions core_helper_API.php
Expand Up @@ -388,6 +388,17 @@ function get_bugnote_count( $p_id ) {
return db_result( $result, 0 );
}
# --------------------
# Returns the number of bugntoes for the given bug_id
function get_bugnote_field( $p_bugnote_id, $p_field_name ) {
global $g_mantis_bugnote_table;

$query = "SELECT $p_field_name
FROM $g_mantis_bugnote_table
WHERE id ='$p_bugnote_id'";
$result = db_query( $query );
return db_result( $result, 0 );
}
# --------------------
# Returns the specified field of the project
function get_current_project_field( $p_field_name ) {
global $g_mantis_project_table, $g_project_cookie_val;
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -21,6 +21,7 @@ Mantis
* Fixed project doc upload error. Error message was misreported.
* Fixed problem with bottom page menu not displaying when turned on.
* Fixed warning message on report. Warning: Undefined variable: f_file_name ...
* Fixed edit bugnote to allow the correct users to edit and update.
* Modified accounts so that protected accounts are not accessible by the user.
* Modified report page formating.
* Modified file size reports to show up as bytes.
Expand Down

0 comments on commit 0947703

Please sign in to comment.