Skip to content

Commit

Permalink
Reporter not allowed changing Reporter when limit_reporters = ON
Browse files Browse the repository at this point in the history
When reporters are limited to their own issues and allowed to update
issues, they are able to change the issue's reporter (and gain
visibility on existence of other reporters).

This commit fixes the problem by only displaying the current reporter's
name (i.e without the [edit] ajax) when $g_limit_reporters = ON and the
current user's access level is greater than REPORTER.

Fixes #15770
  • Loading branch information
dregad committed Sep 26, 2013
1 parent 281fa5e commit 00b6e31
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions bug_update_advanced_page.php
Expand Up @@ -214,13 +214,22 @@
echo '<td class="category">', lang_get( 'reporter' ), '</td>';
echo '<td>';

if ( ON == config_get( 'use_javascript' ) ) {
$t_username = prepare_user_name( $tpl_bug->reporter_id );
echo ajax_click_to_edit( $t_username, 'reporter_id', 'entrypoint=issue_reporter_combobox&issue_id=' . $tpl_bug_id );
# Do not allow the bug's reporter to edit the Reporter field
# when limit_reporters is ON
if( ON === config_get( 'limit_reporters' )

This comment has been minimized.

Copy link
@atrol

atrol Sep 27, 2013

Member

Is there a special reaon for ON === config_get ?
Nearly all similar comparisons are ON == config_get

This comment has been minimized.

Copy link
@dregad

dregad Sep 27, 2013

Author Member

I don't remember any particular reason for this, but I wrote that patch a long time ago - maybe just letting my finger too long on the keyboard ;)

This comment has been minimized.

Copy link
@dregad

dregad Oct 1, 2013

Author Member

Fixed in b30a312

&& !access_has_project_level( REPORTER + 1, $tpl_bug->project_id )
) {
echo string_attribute( user_get_name( $tpl_bug->reporter_id ) );
} else {
echo '<select ', helper_get_tab_index(), ' name="reporter_id">';
print_reporter_option_list( $tpl_bug->reporter_id, $tpl_bug->project_id );
echo '</select>';

if ( ON == config_get( 'use_javascript' ) ) {
$t_username = prepare_user_name( $tpl_bug->reporter_id );
echo ajax_click_to_edit( $t_username, 'reporter_id', 'entrypoint=issue_reporter_combobox&issue_id=' . $tpl_bug_id );
} else {
echo '<select ', helper_get_tab_index(), ' name="reporter_id">';
print_reporter_option_list( $tpl_bug->reporter_id, $tpl_bug->project_id );
echo '</select>';
}
}

echo '</td>';
Expand Down

0 comments on commit 00b6e31

Please sign in to comment.