aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-08-12 12:42:42 +0000
committerbbaetz%student.usyd.edu.au <>2002-08-12 12:42:42 +0000
commit61ddf0a32846fdf2607043d94af1a0a86b80f6fc (patch)
tree714517b4c6b9e33b10a12aa5a4b99641bcafefef /describecomponents.cgi
parentBug 162217: fixed my bustage introduced in bug 160410; yes, I owe the whole B... (diff)
downloadbugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.gz
bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.bz2
bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.zip
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();