summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-09-19 15:54:42 +0200
committergerv%gerv.net <>2002-09-19 15:54:42 +0200
commit57027d51ead542b621d8c93e4aaec73f791afe16 (patch)
tree90fa7d211aa9035bb10ffd7c0a68caa22c77e8fe
parent6fa5c6eccf660b60ff65e5b46e0c66968b19351c (diff)
downloadbugzilla-57027d51ead542b621d8c93e4aaec73f791afe16.tar.gz
bugzilla-57027d51ead542b621d8c93e4aaec73f791afe16.tar.xz
Bug 169561 - Speed up UserInGroup by using cached information. Patch by gerv; r=bbaetz, joel, myk.
-rw-r--r--globals.pl15
1 files changed, 1 insertions, 14 deletions
diff --git a/globals.pl b/globals.pl
index 29582e153..3edcab460 100644
--- a/globals.pl
+++ b/globals.pl
@@ -1186,21 +1186,8 @@ sub SqlQuote {
return "'$str'";
}
-
-
sub UserInGroup {
- my ($groupname) = (@_);
- if ($::usergroupset eq "0") {
- return 0;
- }
- PushGlobalSQLState();
- SendSQL("select (bit & $::usergroupset) != 0 from groups where name = " . SqlQuote($groupname));
- my $bit = FetchOneColumn();
- PopGlobalSQLState();
- if ($bit) {
- return 1;
- }
- return 0;
+ return $::vars->{'user'}{'groups'}{$_[0]};
}
sub BugInGroup {