You are here

function spaces_is_member in Spaces 5

6 calls to spaces_is_member()
spaces_announce_nodeapi in spaces_announce/spaces_announce.module
Implementation of hook_nodeapi
spaces_feature in ./spaces.module
Test if feature exists
spaces_features_menu in ./spaces.module
returns a keyed array of features split by public/private/group-agnostic TODO: can this be optimized? maybe if we store our data differently : |
spaces_router in ./spaces.module
Consolidated group context routing logic.
theme_spaces_button in ./spaces.module
Generates a themed set of links for node types associated with the current active contexts.

... See full list

File

./spaces.module, line 747

Code

function spaces_is_member($gid = null, $uid = null) {
  global $user;
  $gid = !$gid ? spaces_gid() : $gid;
  $account = $uid ? user_load(array(
    'uid' => $uid,
  )) : $user;
  if (user_access('administer organic groups', $account)) {
    return true;
  }
  else {
    if (is_array($account->og_groups) && $account->og_groups[$gid]) {
      return true;
    }
  }
  return false;
}