summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorzach%zachlipton.com <>2001-08-11 10:18:16 +0200
committerzach%zachlipton.com <>2001-08-11 10:18:16 +0200
commit53d3d353d29c8bd47d90cca6c3f55cf36a1f24ff (patch)
tree9a4a0dbf6a8cf52221c78eb12cdda2432cd75104 /globals.pl
parentf140d47857659874984d028ea146aed4c0337e0a (diff)
downloadbugzilla-53d3d353d29c8bd47d90cca6c3f55cf36a1f24ff.tar.gz
bugzilla-53d3d353d29c8bd47d90cca6c3f55cf36a1f24ff.tar.xz
fix for bug 66235: process_bug.cgi: multiple product change misses the groupset bit. Patch by Myk <myk@mozilla.org> r=Jake, oh, and it's my first checkin, yahoo!
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl24
1 files changed, 24 insertions, 0 deletions
diff --git a/globals.pl b/globals.pl
index 51fe1ddee..29024e26d 100644
--- a/globals.pl
+++ b/globals.pl
@@ -1108,6 +1108,16 @@ sub UserInGroup {
return 0;
}
+sub BugInGroup {
+ my ($bugid, $groupname) = (@_);
+ my $groupbit = GroupNameToBit($groupname);
+ PushGlobalSQLState();
+ SendSQL("SELECT (bugs.groupset & $groupbit) != 0 FROM bugs WHERE bugs.bug_id = $bugid");
+ my $bugingroup = FetchOneColumn();
+ PopGlobalSQLState();
+ return $bugingroup;
+}
+
sub GroupExists {
my ($groupname) = (@_);
ConnectToDatabase();
@@ -1116,11 +1126,25 @@ sub GroupExists {
return $count;
}
+# Given the name of an existing group, returns the bit associated with it.
+# If the group does not exist, returns 0.
+# !!! Remove this function when the new group system is implemented!
+sub GroupNameToBit {
+ my ($groupname) = (@_);
+ ConnectToDatabase();
+ PushGlobalSQLState();
+ SendSQL("SELECT bit FROM groups WHERE name = " . SqlQuote($groupname));
+ my $bit = FetchOneColumn() || 0;
+ PopGlobalSQLState();
+ return $bit;
+}
+
# Determines whether or not a group is active by checking
# the "isactive" column for the group in the "groups" table.
# Note: This function selects groups by bit rather than by name.
sub GroupIsActive {
my ($groupbit) = (@_);
+ $groupbit ||= 0;
ConnectToDatabase();
SendSQL("select isactive from groups where bit=$groupbit");
my $isactive = FetchOneColumn();