summaryrefslogtreecommitdiffstats
path: root/describecomponents.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-08-12 14:42:42 +0200
committerbbaetz%student.usyd.edu.au <>2002-08-12 14:42:42 +0200
commit61ddf0a32846fdf2607043d94af1a0a86b80f6fc (patch)
tree714517b4c6b9e33b10a12aa5a4b99641bcafefef /describecomponents.cgi
parent17b301e76d886afd5be8f4e9919afb4446e49405 (diff)
downloadbugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.gz
bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.xz
Bug 43600 - Convert products/components to use ids instead of names.
Initial attempt by jake@bugzilla.org, updated by me r=joel, preed
Diffstat (limited to 'describecomponents.cgi')
-rwxr-xr-xdescribecomponents.cgi13
1 files changed, 7 insertions, 6 deletions
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();