You are here

function spaces_og_is_member in Spaces 6

Same name and namespace in other branches
  1. 5.2 spaces_og.module \spaces_og_is_member()
  2. 6.2 spaces_og/spaces_og.module \spaces_og_is_member()

Tests for user membership in group

1 call to spaces_og_is_member()
spaces_og.module in spaces_og/spaces_og.module

File

spaces_og/spaces_og.module, line 893

Code

function spaces_og_is_member($gid = null, $uid = null) {
  return og_is_group_member($gid);
  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;
}