You are here

function pmteam_user_belongs_to_team in Drupal PM (Project Management) 7

Returns whether user is in a PM Team based on team $node and user $account

File

pmteam/pmteam.module, line 425
Functionality for the Project Management Team module Organized into the following sections:

Code

function pmteam_user_belongs_to_team($team, $person_or_organization_nid) {
  $node = node_load($team);

  // Check for person_or_organization_nid in the team members array and return TRUE / FALSE
  if (is_array($node->members_array)) {
    return array_key_exists($person_or_organization_nid, $node->members_array);
  }
  else {
    return FALSE;
  }
}