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
46c78a8c
Commit
46c78a8c
authored
May 08, 2006
by
lpsolit%gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 332521: Remove GroupIdToName() from globals.pl - Patch by Frédéric Buclin…
Bug 332521: Remove GroupIdToName() from globals.pl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
parent
0aeb1349
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
27 deletions
+22
-27
Flag.pm
Bugzilla/Flag.pm
+2
-2
FlagType.pm
Bugzilla/FlagType.pm
+2
-2
editproducts.cgi
editproducts.cgi
+8
-8
globals.pl
globals.pl
+0
-9
process_bug.cgi
process_bug.cgi
+10
-6
No files found.
Bugzilla/Flag.pm
View file @
46c78a8c
...
...
@@ -374,12 +374,12 @@ sub validate {
# and can rerequest set flags.
next
if
((
$status
eq
'X'
||
$status
eq
'?'
)
&&
(
!
$flag
->
{
type
}
->
{
request_gid
}
||
$user
->
in_group
(
&::
GroupIdToName
(
$flag
->
{
type
}
->
{
request_gid
})
)));
||
$user
->
in_group
_id
(
$flag
->
{
type
}
->
{
request_gid
}
)));
# - User in the $grant_gid group can set/clear flags,
# including "+" and "-"
next
if
(
!
$flag
->
{
type
}
->
{
grant_gid
}
||
$user
->
in_group
(
&::
GroupIdToName
(
$flag
->
{
type
}
->
{
grant_gid
})
));
||
$user
->
in_group
_id
(
$flag
->
{
type
}
->
{
grant_gid
}
));
# - Any other flag modification is denied
ThrowUserError
(
"flag_update_denied"
,
...
...
Bugzilla/FlagType.pm
View file @
46c78a8c
...
...
@@ -431,12 +431,12 @@ sub validate {
# Make sure the user is authorized to modify flags, see bug 180879
# - User in the $grant_gid group can set flags, including "+" and "-"
next
if
(
!
$flag_type
->
{
grant_gid
}
||
$user
->
in_group
(
&::
GroupIdToName
(
$flag_type
->
{
grant_gid
})
));
||
$user
->
in_group
_id
(
$flag_type
->
{
grant_gid
}
));
# - User in the $request_gid group can request flags
next
if
(
$status
eq
'?'
&&
(
!
$flag_type
->
{
request_gid
}
||
$user
->
in_group
(
&::
GroupIdToName
(
$flag_type
->
{
request_gid
})
)));
||
$user
->
in_group
_id
(
$flag_type
->
{
request_gid
}
)));
# - Any other flag modification is denied
ThrowUserError
(
"flag_update_denied"
,
...
...
editproducts.cgi
View file @
46c78a8c
...
...
@@ -660,11 +660,12 @@ if ($action eq 'updategroupcontrols') {
my
$bugs
=
$dbh
->
selectall_arrayref
(
$sth_Select
,
undef
,
(
$groupid
,
$product
->
id
));
my
(
$removed
,
$timestamp
)
=
$dbh
->
selectrow_array
(
$sth_Select2
,
undef
,
$groupid
);
foreach
my
$bug
(
@$bugs
)
{
my
(
$bugid
,
$mailiscurrent
)
=
@$bug
;
$sth_Delete
->
execute
(
$bugid
,
$groupid
);
my
(
$removed
,
$timestamp
)
=
$dbh
->
selectrow_array
(
$sth_Select2
,
undef
,
$groupid
);
LogActivityEntry
(
$bugid
,
"bug_group"
,
$removed
,
""
,
$whoid
,
$timestamp
);
...
...
@@ -677,8 +678,7 @@ if ($action eq 'updategroupcontrols') {
}
$count
++
;
}
my
%
group
=
(
name
=>
GroupIdToName
(
$groupid
),
bug_count
=>
$count
);
my
%
group
=
(
name
=>
$removed
,
bug_count
=>
$count
);
push
(
@removed_na
,
\%
group
);
}
...
...
@@ -703,11 +703,12 @@ if ($action eq 'updategroupcontrols') {
my
$bugs
=
$dbh
->
selectall_arrayref
(
$sth_Select
,
undef
,
(
$groupid
,
$product
->
id
));
my
(
$added
,
$timestamp
)
=
$dbh
->
selectrow_array
(
$sth_Select2
,
undef
,
$groupid
);
foreach
my
$bug
(
@$bugs
)
{
my
(
$bugid
,
$mailiscurrent
)
=
@$bug
;
$sth_Insert
->
execute
(
$bugid
,
$groupid
);
my
(
$added
,
$timestamp
)
=
$dbh
->
selectrow_array
(
$sth_Select2
,
undef
,
$groupid
);
LogActivityEntry
(
$bugid
,
"bug_group"
,
""
,
$added
,
$whoid
,
$timestamp
);
...
...
@@ -720,8 +721,7 @@ if ($action eq 'updategroupcontrols') {
}
$count
++
;
}
my
%
group
=
(
name
=>
GroupIdToName
(
$groupid
),
bug_count
=>
$count
);
my
%
group
=
(
name
=>
$added
,
bug_count
=>
$count
);
push
(
@added_mandatory
,
\%
group
);
}
...
...
globals.pl
View file @
46c78a8c
...
...
@@ -306,15 +306,6 @@ sub get_legal_field_values {
return
@$result_ref
;
}
sub
GroupIdToName
{
my
(
$groupid
)
=
(
@_
);
PushGlobalSQLState
();
SendSQL
(
"SELECT name FROM groups WHERE id = $groupid"
);
my
$name
=
FetchOneColumn
();
PopGlobalSQLState
();
return
$name
;
}
############# Live code below here (that is, not subroutine defs) #############
use
Bugzilla
;
...
...
process_bug.cgi
View file @
46c78a8c
...
...
@@ -1749,9 +1749,10 @@ foreach my $id (@idlist) {
VALUES (?, ?)}
);
foreach
my
$grouptoadd
(
@groupAdd
,
keys
%
groupsrequired
)
{
next
if
$groupsforbidden
{
$grouptoadd
};
push
(
@groupAddNamesAll
,
GroupIdToName
(
$grouptoadd
));
my
$group_obj
=
new
Bugzilla::
Group
(
$grouptoadd
);
push
(
@groupAddNamesAll
,
$group_obj
->
name
);
if
(
!
BugInGroupId
(
$id
,
$grouptoadd
))
{
push
(
@groupAddNames
,
GroupIdToName
(
$grouptoadd
)
);
push
(
@groupAddNames
,
$group_obj
->
name
);
$sth
->
execute
(
$id
,
$grouptoadd
);
}
}
...
...
@@ -1760,10 +1761,11 @@ foreach my $id (@idlist) {
$sth
=
$dbh
->
prepare
(
q{DELETE FROM bug_group_map
WHERE bug_id = ? AND group_id = ?}
);
foreach
my
$grouptodel
(
@groupDel
,
keys
%
groupsforbidden
)
{
push
(
@groupDelNamesAll
,
GroupIdToName
(
$grouptodel
));
my
$group_obj
=
new
Bugzilla::
Group
(
$grouptodel
);
push
(
@groupDelNamesAll
,
$group_obj
->
name
);
next
if
$groupsrequired
{
$grouptodel
};
if
(
BugInGroupId
(
$id
,
$grouptodel
))
{
push
(
@groupDelNames
,
GroupIdToName
(
$grouptodel
)
);
push
(
@groupDelNames
,
$group_obj
->
name
);
}
$sth
->
execute
(
$id
,
$grouptodel
);
}
...
...
@@ -1985,10 +1987,12 @@ foreach my $id (@idlist) {
my
$thisadd
=
grep
(
(
$_
==
$groupid
),
@groupstoadd
);
my
$thisdel
=
grep
(
(
$_
==
$groupid
),
@groupstoremove
);
if
(
$thisadd
)
{
push
(
@DefGroupsAdded
,
GroupIdToName
(
$groupid
));
my
$group_obj
=
new
Bugzilla::
Group
(
$groupid
);
push
(
@DefGroupsAdded
,
$group_obj
->
name
);
$sth_insert
->
execute
(
$id
,
$groupid
);
}
elsif
(
$thisdel
)
{
push
(
@DefGroupsRemoved
,
GroupIdToName
(
$groupid
));
my
$group_obj
=
new
Bugzilla::
Group
(
$groupid
);
push
(
@DefGroupsRemoved
,
$group_obj
->
name
);
$sth_delete
->
execute
(
$id
,
$groupid
);
}
}
...
...
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