mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 00:50:40 +00:00
Bug 169561 - Speed up UserInGroup by using cached information. Patch by gerv; r=bbaetz, joel, myk.
This commit is contained in:
parent
bd5fa313f7
commit
9463bbea73
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user