Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reporter not allowed changing Reporter when limit_reporters = ON
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
Showing
1 changed file
with
15 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dregad
Author
Member
|
||
&& !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>'; | ||
|
Is there a special reaon for ON === config_get ?
Nearly all similar comparisons are ON == config_get