You are here

function og_og_membership_update in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og.module \og_og_membership_update()

Implements hook_og_membership_update().

File

./og.module, line 608
Enable users to create and manage groups with roles and permissions.

Code

function og_og_membership_update($membership) {
  if ($membership->entity_type == 'user' && module_exists('rules')) {
    if ($membership->original->state != OG_STATE_ACTIVE && $membership->state == OG_STATE_ACTIVE) {
      rules_invoke_event('og_user_approved', $membership, entity_metadata_wrapper('user', $membership->etid));
    }
    if ($membership->original->state != OG_STATE_BLOCKED && $membership->state == OG_STATE_BLOCKED) {
      rules_invoke_event('og_user_blocked', $membership, entity_metadata_wrapper('user', $membership->etid));
    }
  }
}