Commit 57027d51 authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 169561 - Speed up UserInGroup by using cached information. Patch by gerv; r=bbaetz, joel, myk.

parent 6fa5c6ec
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment