Commit 049069a3 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 341867: post_bug.cgi lets users with editbugs and canconfirm privs enter…

Bug 341867: post_bug.cgi lets users with editbugs and canconfirm privs enter bugs as UNCONFIRMED even when votes_to_confirm is 0 - Patch by Frédéric Buclin <LpSolit@gmail.com> r=bkor a=myk
parent 6c1536df
...@@ -165,11 +165,7 @@ $cgi->param('bug_file_loc', '') if $cgi->param('bug_file_loc') eq 'http://'; ...@@ -165,11 +165,7 @@ $cgi->param('bug_file_loc', '') if $cgi->param('bug_file_loc') eq 'http://';
# Default assignee is the component owner. # Default assignee is the component owner.
if (!UserInGroup("editbugs") || $cgi->param('assigned_to') eq "") { if (!UserInGroup("editbugs") || $cgi->param('assigned_to') eq "") {
my $initialowner = $dbh->selectrow_array(q{SELECT initialowner $cgi->param(-name => 'assigned_to', -value => $component->default_assignee->id);
FROM components
WHERE id = ?},
undef, $component->id);
$cgi->param(-name => 'assigned_to', -value => $initialowner);
} else { } else {
$cgi->param(-name => 'assigned_to', $cgi->param(-name => 'assigned_to',
-value => login_to_id(trim($cgi->param('assigned_to')), THROW_ERROR)); -value => login_to_id(trim($cgi->param('assigned_to')), THROW_ERROR));
...@@ -194,10 +190,7 @@ if (Bugzilla->params->{"useqacontact"}) { ...@@ -194,10 +190,7 @@ if (Bugzilla->params->{"useqacontact"}) {
my $qa_contact; my $qa_contact;
if (!UserInGroup("editbugs") || !defined $cgi->param('qa_contact') if (!UserInGroup("editbugs") || !defined $cgi->param('qa_contact')
|| trim($cgi->param('qa_contact')) eq "") { || trim($cgi->param('qa_contact')) eq "") {
($qa_contact) = $dbh->selectrow_array(q{SELECT initialqacontact $qa_contact = $component->default_qa_contact->id;
FROM components
WHERE id = ?},
undef, $component->id);
} else { } else {
$qa_contact = login_to_id(trim($cgi->param('qa_contact')), THROW_ERROR); $qa_contact = login_to_id(trim($cgi->param('qa_contact')), THROW_ERROR);
} }
...@@ -208,30 +201,19 @@ if (Bugzilla->params->{"useqacontact"}) { ...@@ -208,30 +201,19 @@ if (Bugzilla->params->{"useqacontact"}) {
} }
} }
if (UserInGroup("editbugs") || UserInGroup("canconfirm")) { my $bug_status = 'UNCONFIRMED';
# Default to NEW if the user hasn't selected another status if ($product->votes_to_confirm) {
if (!defined $cgi->param('bug_status')) { # Default to NEW if the user with privs hasn't selected another status.
$cgi->param(-name => 'bug_status', -value => "NEW"); if (UserInGroup('editbugs') || UserInGroup('canconfirm')) {
$bug_status = scalar($cgi->param('bug_status')) || 'NEW';
} }
} else { } else {
# Default to UNCONFIRMED if we are using it, NEW otherwise $bug_status = 'NEW';
$cgi->param(-name => 'bug_status', -value => 'UNCONFIRMED');
my $votestoconfirm = $dbh->selectrow_array(q{SELECT votestoconfirm
FROM products
WHERE id = ?},
undef, $product->id);
if (!$votestoconfirm) {
$cgi->param(-name => 'bug_status', -value => "NEW");
}
} }
$cgi->param(-name => 'bug_status', -value => $bug_status);
if (!defined $cgi->param('target_milestone')) { if (!defined $cgi->param('target_milestone')) {
my $defaultmilestone = $dbh->selectrow_array(q{SELECT defaultmilestone $cgi->param(-name => 'target_milestone', -value => $product->default_milestone);
FROM products
WHERE name = ?},
undef, $product->name);
$cgi->param(-name => 'target_milestone', -value => $defaultmilestone);
} }
if (!Bugzilla->params->{'letsubmitterchoosepriority'}) { if (!Bugzilla->params->{'letsubmitterchoosepriority'}) {
......
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