Skip to content

Commit

Permalink
Fix #9803: Hide tagging filter if user does not have view access.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyreese committed Nov 13, 2008
1 parent 7289ce7 commit 9e6bc9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions core/filter_api.php
Expand Up @@ -3635,6 +3635,10 @@ function print_filter_relationship_type(){
}

function print_filter_tag_string() {
if ( !access_has_global_level( config_get( 'tag_view_threshold' ) ) ) {
return;
}

global $t_filter;
$t_tag_string = $t_filter['tag_string'];
if ( $t_filter['tag_select'] != 0 ) {
Expand Down
6 changes: 4 additions & 2 deletions view_filters_page.php
Expand Up @@ -164,6 +164,8 @@ function SwitchDateFields() {
$t_show_version = ( ON == config_get( 'show_product_version' ) )
|| ( ( AUTO == config_get( 'show_product_version' ) )
&& ( count( version_get_all_rows_with_subs( $t_project_id ) ) > 0 ) );

$t_show_tags = access_has_global_level( config_get( 'tag_view_threshold' ) );
?>
<br />
<form method="post" name="filters" action="<?php echo $t_action; ?>">
Expand Down Expand Up @@ -419,7 +421,7 @@ function SwitchDateFields() {
</tr>
<tr class="row-category2">
<td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"><?php echo lang_get( 'search' ) ?></td>
<td class="small-caption" colspan="<?php echo ( ( $t_filter_cols - 2 ) * $t_custom_cols ); ?>"><?php echo lang_get( 'tags' ) ?></td>
<td class="small-caption" colspan="<?php echo ( ( $t_filter_cols - 2 ) * $t_custom_cols ); ?>"><?php if ( $t_show_tags ) { echo lang_get( 'tags' ); } ?></td>
<td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"></td>
</tr>
<tr>
Expand All @@ -428,7 +430,7 @@ function SwitchDateFields() {
<input type="text" size="16" name="search" value="<?php echo string_html_specialchars( $t_filter['search'] ); ?>" />
</td>

<td class="small-caption" colspan="<?php echo ( ( $t_filter_cols - 2 ) * $t_custom_cols ); ?>"><?php print_filter_tag_string() ?></td>
<td class="small-caption" colspan="<?php echo ( ( $t_filter_cols - 2 ) * $t_custom_cols ); ?>"><?php if ( $t_show_tags ) { print_filter_tag_string(); } ?></td>

<!-- Submit button -->
<td class="right" colspan="<?php echo ( 1 * $t_custom_cols ); ?>">
Expand Down

0 comments on commit 9e6bc9f

Please sign in to comment.