From 9463bbea737394a9fdd9fc3de4c833974aca0df0 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" Date: Thu, 19 Sep 2002 06:54:42 +0000 Subject: [PATCH] Bug 169561 - Speed up UserInGroup by using cached information. Patch by gerv; r=bbaetz, joel, myk. --- webtools/bugzilla/globals.pl | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/webtools/bugzilla/globals.pl b/webtools/bugzilla/globals.pl index 29582e153766..3edcab46040e 100644 --- a/webtools/bugzilla/globals.pl +++ b/webtools/bugzilla/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 {