Commit af49545e authored by Evan Prodromou's avatar Evan Prodromou

reduce the number of calls to get profile groups

parent 58d798b6
......@@ -243,9 +243,14 @@ class Profile extends Memcached_DataObject
function isMember($group)
{
$gm = Group_member::pkeyGet(array('profile_id' => $this->id,
'group_id' => $group->id));
return (!empty($gm));
$groups = $this->getGroups(0, null);
$gs = $groups->fetchAll();
foreach ($gs as $g) {
if ($group->id == $g->id) {
return true;
}
}
return false;
}
function isAdmin($group)
......
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