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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
363f5a4e
Commit
363f5a4e
authored
Aug 23, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
parent
2de6abfd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
25 deletions
+35
-25
Bug.pm
Bugzilla/Bug.pm
+31
-0
post_bug.cgi
post_bug.cgi
+4
-25
No files found.
Bugzilla/Bug.pm
View file @
363f5a4e
...
...
@@ -406,6 +406,37 @@ sub _check_short_desc {
return
$short_desc
;
}
# Unlike other checkers, this one doesn't return anything.
sub
_check_strict_isolation
{
my
(
$product
,
$cc_ids
,
$assignee_id
,
$qa_contact_id
)
=
@_
;
return
unless
Bugzilla
->
params
->
{
'strict_isolation'
};
my
@related_users
=
@$cc_ids
;
push
(
@related_users
,
$assignee_id
);
if
(
Bugzilla
->
params
->
{
'useqacontact'
}
&&
$qa_contact_id
)
{
push
(
@related_users
,
$qa_contact_id
);
}
# For each unique user in @related_users...(assignee and qa_contact
# could be duplicates of users in the CC list)
my
%
unique_users
=
map
{
$_
=>
1
}
@related_users
;
my
@blocked_users
;
foreach
my
$pid
(
keys
%
unique_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
});
}
}
sub
_check_qa_contact
{
my
(
$name
,
$component
)
=
@_
;
my
$user
=
Bugzilla
->
user
;
...
...
post_bug.cgi
View file @
363f5a4e
...
...
@@ -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
);
}
...
...
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