Commit c17a0e4f authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 494072: editvalues.cgi lets you edit product names - Patch by Fré©ric…

Bug 494072: editvalues.cgi lets you edit product names - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent 5a10ebe6
...@@ -71,11 +71,16 @@ Bugzilla->user->in_group('admin') || ...@@ -71,11 +71,16 @@ Bugzilla->user->in_group('admin') ||
my $action = trim($cgi->param('action') || ''); my $action = trim($cgi->param('action') || '');
my $token = $cgi->param('token'); my $token = $cgi->param('token');
# Fields listed here must not be edited from this interface.
my @non_editable_fields = qw(product);
my %block_list = map { $_ => 1 } @non_editable_fields;
# #
# field = '' -> Show nice list of fields # field = '' -> Show nice list of fields
# #
if (!$cgi->param('field')) { if (!$cgi->param('field')) {
my @field_list = Bugzilla->get_fields({ is_select => 1 }); my @field_list = grep { !$block_list{$_->name} }
Bugzilla->get_fields({ is_select => 1 });
$vars->{'fields'} = \@field_list; $vars->{'fields'} = \@field_list;
$template->process("admin/fieldvalues/select-field.html.tmpl", $vars) $template->process("admin/fieldvalues/select-field.html.tmpl", $vars)
...@@ -85,7 +90,7 @@ if (!$cgi->param('field')) { ...@@ -85,7 +90,7 @@ if (!$cgi->param('field')) {
# At this point, the field must be defined. # At this point, the field must be defined.
my $field = Bugzilla::Field->check($cgi->param('field')); my $field = Bugzilla::Field->check($cgi->param('field'));
if (!$field->is_select) { if (!$field->is_select || $block_list{$field->name}) {
ThrowUserError('fieldname_invalid', { field => $field }); ThrowUserError('fieldname_invalid', { field => $field });
} }
$vars->{'field'} = $field; $vars->{'field'} = $field;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment