summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Flag.pm4
-rw-r--r--Bugzilla/FlagType.pm4
-rwxr-xr-xeditproducts.cgi16
-rw-r--r--globals.pl9
-rwxr-xr-xprocess_bug.cgi16
5 files changed, 22 insertions, 27 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 97d8e8c7c..9d55fcf33 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -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",
diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm
index b18c4a2de..313006377 100644
--- a/Bugzilla/FlagType.pm
+++ b/Bugzilla/FlagType.pm
@@ -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",
diff --git a/editproducts.cgi b/editproducts.cgi
index 9123f034f..942375688 100755
--- a/editproducts.cgi
+++ b/editproducts.cgi
@@ -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);
}
diff --git a/globals.pl b/globals.pl
index 38791a93b..ac95974d2 100644
--- a/globals.pl
+++ b/globals.pl
@@ -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;
diff --git a/process_bug.cgi b/process_bug.cgi
index 9e0bc42bc..8dfa4018d 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -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);
}
}