You are here

function og_is_group_member in Organic groups 5.3

Same name and namespace in other branches
  1. 5.8 og.module \og_is_group_member()
  2. 5 og.module \og_is_group_member()
  3. 6.2 og.module \og_is_group_member()
  4. 6 og.module \og_is_group_member()

Check a user's membership in a group. Site admins always return TRUE.

2 calls to og_is_group_member()
og_workflow_ng_action_subscribe_user in ./og_workflow_ng.inc
Action: Subscribe user to group.
og_workflow_ng_condition_user_in_group in ./og_workflow_ng.inc
Condition: User is group member.

File

./og.module, line 2083

Code

function og_is_group_member($gid, $user) {
  $groups = array_keys($user->og_groups);
  return user_access('administer nodes') || in_array($gid, $groups) ? TRUE : FALSE;
}