From a1e8485ef53e7dcab07bae5c2ddc9d0c94a97ffb Mon Sep 17 00:00:00 2001 From: "dave%intrec.com" <> Date: Tue, 21 Nov 2000 03:42:36 +0000 Subject: Fix for bug 45586: Component, Version, and Milestone values are no longer shown that belong to products the user can't see if usebuggroups is active. Patch by Matthias Radestock --- query.cgi | 62 +++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 15 deletions(-) (limited to 'query.cgi') diff --git a/query.cgi b/query.cgi index 23bbf58cc..ea96e37ee 100755 --- a/query.cgi +++ b/query.cgi @@ -20,6 +20,7 @@ # # Contributor(s): Terry Weissman # David Gardiner +# Matthias Radestock use diagnostics; use strict; @@ -278,16 +279,47 @@ my $emailinput2 = GenerateEmailInput(2); # have access to. remove them from the list. @::product_list = (); +my %component_set; +my %version_set; +my %milestone_set; foreach my $p (@::legal_product) { - if(Param("usebuggroupsentry") - && GroupExists($p) - && !UserInGroup($p)) { - # If we're using bug groups to restrict entry on products, and - # this product has a bug group, and the user is not in that - # group, we don't want to include that product in this list. - next; - } - push @::product_list, $p; + if(Param("usebuggroups") + && GroupExists($p) + && !UserInGroup($p)) { + # If we're using bug groups to restrict entry on products, and + # this product has a bug group, and the user is not in that + # group, we don't want to include that product in this list. + next; + } + push @::product_list, $p; + foreach my $c (@{$::components{$p}}) { + $component_set{$c} = 1; + } + foreach my $v (@{$::versions{$p}}) { + $version_set{$v} = 1; + } + foreach my $m (@{$::target_milestone{$p}}) { + $milestone_set{$m} = 1; + } +} + +@::component_list = (); +@::version_list = (); +@::milestone_list = (); +foreach my $c (@::legal_components) { + if ($component_set{$c}) { + push @::component_list, $c; + } +} +foreach my $v (@::legal_versions) { + if ($version_set{$v}) { + push @::version_list, $v; + } +} +foreach my $m (@::legal_target_milestone) { + if ($milestone_set{$m}) { + push @::milestone_list, $m; + } } # javascript @@ -308,16 +340,16 @@ my $m; my $i = 0; my $j = 0; -foreach $c (@::legal_components) { +foreach $c (@::component_list) { $jscript .= "cpts['$c'] = new Array();\n"; } -foreach $v (@::legal_versions) { +foreach $v (@::version_list) { $jscript .= "vers['$v'] = new Array();\n"; } my $tm; -foreach $tm (@::legal_target_milestone) { +foreach $tm (@::milestone_list) { $jscript .= "tms['$tm'] = new Array();\n"; } @@ -629,13 +661,13 @@ print " "; @@ -643,7 +675,7 @@ if (Param("usetargetmilestone")) { print " "; } -- cgit v1.2.3-24-g4f1b