function spaces_og_is_member in Spaces 5.2
Same name and namespace in other branches
- 6 spaces_og/spaces_og.module \spaces_og_is_member()
- 6.2 spaces_og/spaces_og.module \spaces_og_is_member()
Tests for user membership in group
1 call to spaces_og_is_member()
File
- ./
spaces_og.module, line 822
Code
function spaces_og_is_member($gid = null, $uid = null) {
global $user;
if (!$gid && ($space = spaces_get_space())) {
$gid = $space->sid;
}
$account = $uid ? user_load(array(
'uid' => $uid,
)) : $user;
if ($gid && $account) {
if (user_access('administer organic groups', $account)) {
return true;
}
else {
if (is_array($account->og_groups) && $account->og_groups[$gid]) {
return true;
}
}
}
return false;
}