Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
bb496330
Commit
bb496330
authored
Aug 22, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 348539: Move CC validation out of post_bug.cgi and into Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bkor, a=myk
parent
3f5c73cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
Bug.pm
Bugzilla/Bug.pm
+13
-0
post_bug.cgi
post_bug.cgi
+8
-17
No files found.
Bugzilla/Bug.pm
View file @
bb496330
...
...
@@ -288,6 +288,19 @@ sub _check_bug_status {
return
$status
;
}
sub
_check_cc
{
my
(
$ccs
)
=
@_
;
return
[]
unless
$ccs
;
my
%
cc_ids
;
foreach
my
$person
(
@$ccs
)
{
next
unless
$person
;
my
$id
=
login_to_id
(
$person
,
THROW_ERROR
);
$cc_ids
{
$id
}
=
1
;
}
return
[
keys
%
cc_ids
];
}
sub
_check_comment
{
my
(
$comment
)
=
@_
;
...
...
post_bug.cgi
View file @
bb496330
...
...
@@ -220,19 +220,8 @@ push(@used_fields, "product_id");
$cgi
->
param
(
-
name
=>
'component_id'
,
-
value
=>
$component
->
id
);
push
(
@used_fields
,
"component_id"
);
my
%
ccids
;
# Create the ccid hash for inserting into the db
# use a hash rather than a list to avoid adding users twice
if
(
defined
$cgi
->
param
(
'cc'
))
{
foreach
my
$person
(
$cgi
->
param
(
'cc'
))
{
next
unless
$person
;
my
$ccid
=
login_to_id
(
$person
,
THROW_ERROR
);
if
(
$ccid
&&
!
$ccids
{
$ccid
})
{
$ccids
{
$ccid
}
=
1
;
}
}
}
my
@cc_ids
=
@
{
Bugzilla::Bug::
_check_cc
([
$cgi
->
param
(
'cc'
)])};
# Check for valid keywords and create list of keywords to be added to db
# (validity routine copied from process_bug.cgi)
my
@keywordlist
;
...
...
@@ -257,11 +246,13 @@ if ($cgi->param('keywords') && UserInGroup("editbugs")) {
if
(
Bugzilla
->
params
->
{
"strict_isolation"
})
{
my
@blocked_users
=
();
my
%
related_users
=
%
cc
ids
;
$related_users
{
$cgi
->
param
(
'assigned_to'
)}
=
1
;
my
@related_users
=
@cc_
ids
;
push
(
@related_users
,
$cgi
->
param
(
'assigned_to'
))
;
if
(
Bugzilla
->
params
->
{
'useqacontact'
}
&&
$cgi
->
param
(
'qa_contact'
))
{
$related_users
{
$cgi
->
param
(
'qa_contact'
)}
=
1
;
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
))
{
...
...
@@ -440,7 +431,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
(
keys
(
%
ccids
)
)
{
foreach
my
$ccid
(
@cc_ids
)
{
$sth_cclist
->
execute
(
$id
,
$ccid
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment