diff options
author | mkanat%bugzilla.org <> | 2006-08-23 07:42:25 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-08-23 07:42:25 +0200 |
commit | 363f5a4e621378b1343c4621a765cb9aa9025cb9 (patch) | |
tree | d225177ce1bcc75ef4af6b46b887b55ca60911da /post_bug.cgi | |
parent | 2de6abfda1e684d218b8d9b251a1153ce30f89e2 (diff) | |
download | bugzilla-363f5a4e621378b1343c4621a765cb9aa9025cb9.tar.gz bugzilla-363f5a4e621378b1343c4621a765cb9aa9025cb9.tar.xz |
Bug 349561: Move the strict_isolation check from post_bug into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bkor, a=justdave
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-x | post_bug.cgi | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/post_bug.cgi b/post_bug.cgi index ec44f6c48..dab0ba507 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -221,32 +221,11 @@ push(@used_fields, "product_id"); $cgi->param(-name => 'component_id', -value => $component->id); push(@used_fields, "component_id"); -my @cc_ids = @{Bugzilla::Bug::_check_cc([$cgi->param('cc')])}; +my $cc_ids = Bugzilla::Bug::_check_cc([$cgi->param('cc')]); my @keyword_ids = @{Bugzilla::Bug::_check_keywords($cgi->param('keywords'))}; -if (Bugzilla->params->{"strict_isolation"}) { - my @blocked_users = (); - my @related_users = @cc_ids; - push(@related_users, $cgi->param('assigned_to')); - if (Bugzilla->params->{'useqacontact'} && $cgi->param('qa_contact')) { - push(@related_users, $cgi->param('qa_contact')); - } - # For each unique user in @related_users... - my %related_users = map {$_ => 1} @related_users; - foreach my $pid (keys %related_users) { - my $related_user = Bugzilla::User->new($pid); - if (!$related_user->can_edit_product($product->id)) { - push (@blocked_users, $related_user->login); - } - } - if (scalar(@blocked_users)) { - ThrowUserError("invalid_user_group", - {'users' => \@blocked_users, - 'new' => 1, - 'product' => $product->name - }); - } -} +Bugzilla::Bug::_check_strict_isolation($product, $cc_ids, + $cgi->param('assigned_to'), $cgi->param('qa_contact')); # Check for valid dependency info. foreach my $field ("dependson", "blocked") { @@ -411,7 +390,7 @@ $dbh->do(q{INSERT INTO longdescs (bug_id, who, bug_when, thetext,isprivate) # Insert the cclist into the database my $sth_cclist = $dbh->prepare(q{INSERT INTO cc (bug_id, who) VALUES (?,?)}); -foreach my $ccid (@cc_ids) { +foreach my $ccid (@$cc_ids) { $sth_cclist->execute($id, $ccid); } |