Merge commit 'v7.10.23' into WebGUI8. Tests need fixing.

This commit is contained in:
Colin Kuskie 2011-11-02 11:12:18 -07:00
commit a2a821822d
72 changed files with 578 additions and 132 deletions

View file

@ -981,20 +981,17 @@ sub isInGroup {
### Check stow before we check the cache. Stow is in memory and much faster
my $stow = $session->stow->get("isInGroup", { noclone => 1 }) || {};
return $stow->{$uid}->{$gid} if (exists $stow->{$uid}->{$gid});
### Don't bother checking File Cache if we already have a stow for this group.
### We can find what we need there and save ourselves a bunch of time
my $cache = undef;
my $groupMembers = undef;
unless ($stow->{$uid}->{$gid}) {
$groupMembers = $session->cache->get("groupMembers".$gid) || {};
#If we have this user's membership cached, return what we have stored
if (exists $groupMembers->{$uid}) {
return $groupMembers->{$uid}->{isMember} if (!$self->isVisitor);
return $groupMembers->{$uid}->{$session->getId}->{isMember} #Include the session check for visitors
}
}
my $cache = undef;
my $groupMembers = $session->cache->get("groupMembers".$gid) || {};
#If we have this user's membership cached, return what we have stored
if (exists $groupMembers->{$uid}) {
return $groupMembers->{$uid}->{isMember} if (!$self->isVisitor);
return $groupMembers->{$uid}->{$session->getId}->{isMember} if exists $groupMembers->{$uid}->{$session->getId}; #Include the session check for visitors
}
### Instantiate the group
my $group = WebGUI::Group->new($session,$gid);
if ( !$group ) {
@ -1004,7 +1001,7 @@ sub isInGroup {
#Check the group for membership
my $isInGroup = $group->hasUser($self);
#Write what we found to file cache
$group->cacheGroupings( $self, $isInGroup, $groupMembers );
return $isInGroup;