summaryrefslogtreecommitdiffstats
path: root/editflagtypes.cgi
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-10-06 17:52:33 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-10-06 17:52:33 +0200
commitaafa79dbed67514aede45f884572c30934854107 (patch)
treedef39520441fdc097877f222a32cc86e5e6fda40 /editflagtypes.cgi
parentc034487bf62423265d0832197e0ff490f82330eb (diff)
parent3e1e67bed36bbe454c654f1e0a16ce73e724a5e0 (diff)
downloadbugzilla-aafa79dbed67514aede45f884572c30934854107.tar.gz
bugzilla-aafa79dbed67514aede45f884572c30934854107.tar.xz
merged with upstream 4.2
Diffstat (limited to 'editflagtypes.cgi')
-rwxr-xr-xeditflagtypes.cgi21
1 files changed, 11 insertions, 10 deletions
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index d75bebba2..d28188ad7 100755
--- a/editflagtypes.cgi
+++ b/editflagtypes.cgi
@@ -59,23 +59,24 @@ my @products = @{$vars->{products}};
my $action = $cgi->param('action') || 'list';
my $token = $cgi->param('token');
-my $product = $cgi->param('product');
-my $component = $cgi->param('component');
+my $prod_name = $cgi->param('product');
+my $comp_name = $cgi->param('component');
my $flag_id = $cgi->param('id');
-if ($product) {
+my ($product, $component);
+
+if ($prod_name) {
# Make sure the user is allowed to view this product name.
# Users with global editcomponents privs can see all product names.
- ($product) = grep { lc($_->name) eq lc($product) } @products;
- $product || ThrowUserError('product_access_denied', { name => $cgi->param('product') });
+ ($product) = grep { lc($_->name) eq lc($prod_name) } @products;
+ $product || ThrowUserError('product_access_denied', { name => $prod_name });
}
-if ($component) {
- ($product && $product->id)
- || ThrowUserError('flag_type_component_without_product');
- ($component) = grep { lc($_->name) eq lc($component) } @{$product->components};
+if ($comp_name) {
+ $product || ThrowUserError('flag_type_component_without_product');
+ ($component) = grep { lc($_->name) eq lc($comp_name) } @{$product->components};
$component || ThrowUserError('product_unknown_component', { product => $product->name,
- comp => $cgi->param('component') });
+ comp => $comp_name });
}
# If 'categoryAction' is set, it has priority over 'action'.