From 8a35d21d26138805ddce2f8e45b259a4e79cb259 Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" Date: Thu, 24 Feb 2005 16:32:30 +0000 Subject: [PATCH] Bug 283085 : post_bug.cgi can be used to know which products do not exist and which ones are not accessible Patch by Frederic Buclin r=myk a=myk git-svn-id: svn://10.0.0.236/trunk@169771 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/post_bug.cgi | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mozilla/webtools/bugzilla/post_bug.cgi b/mozilla/webtools/bugzilla/post_bug.cgi index 3e5b289a8a5..4f545fbb2dd 100755 --- a/mozilla/webtools/bugzilla/post_bug.cgi +++ b/mozilla/webtools/bugzilla/post_bug.cgi @@ -78,12 +78,13 @@ $template->process($format->{'template'}, $vars, \$comment) ValidateComment($comment); +# Check that the product exists and that the user +# is allowed to submit bugs in this product. my $product = $::FORM{'product'}; -my $product_id = get_product_id($product); -if (!$product_id) { - ThrowUserError("invalid_product_name", - { product => $product }); +if (!CanEnterProduct($product)) { + ThrowUserError("entry_access_denied", {product => $product}); } +my $product_id = get_product_id($product); # Set cookies if (exists $::FORM{'product'}) { @@ -106,10 +107,6 @@ if (defined $::FORM{'maketemplate'}) { umask 0; # Some sanity checking -if (!CanEnterProduct($product)) { - ThrowUserError("entry_access_denied", {product => $product}); -} - my $component_id = get_component_id($product_id, $::FORM{component}); $component_id || ThrowUserError("require_component");