From 61ddf0a32846fdf2607043d94af1a0a86b80f6fc Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Mon, 12 Aug 2002 12:42:42 +0000 Subject: Bug 43600 - Convert products/components to use ids instead of names. Initial attempt by jake@bugzilla.org, updated by me r=joel, preed --- describecomponents.cgi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'describecomponents.cgi') diff --git a/describecomponents.cgi b/describecomponents.cgi index 2f723757e..edf9349ab 100755 --- a/describecomponents.cgi +++ b/describecomponents.cgi @@ -23,6 +23,7 @@ use vars qw( %FORM + %legal_product $userid ); @@ -85,9 +86,9 @@ my $product = $::FORM{'product'}; # which could enable people guessing product names to determine # whether or not certain products exist in Bugzilla, even if they # cannot get any other information about that product. -grep($product eq $_ , @::legal_product) - || DisplayError("The product name is invalid.") - && exit; +my $product_id = get_product_id($product); + +ThrowUserError("The product name is invalid.") unless $product_id; # Make sure the user is authorized to access this product. if (Param("usebuggroups") && GroupExists($product)) { @@ -102,9 +103,9 @@ if (Param("usebuggroups") && GroupExists($product)) { ###################################################################### my @components; -SendSQL("SELECT value, initialowner, initialqacontact, description FROM " . - "components WHERE program = " . SqlQuote($product) . " ORDER BY " . - "value"); +SendSQL("SELECT name, initialowner, initialqacontact, description FROM " . + "components WHERE product_id = $product_id ORDER BY " . + "name"); while (MoreSQLData()) { my ($name, $initialowner, $initialqacontact, $description) = FetchSQLData(); -- cgit v1.2.3-24-g4f1b