You are here

function og_rules_action_subscribe_user in Organic groups 6

Same name and namespace in other branches
  1. 6.2 includes/og.rules.inc \og_rules_action_subscribe_user()

Action: Subscribe user to group.

File

includes/og.rules.inc, line 124
Rules integration for the og module.

Code

function og_rules_action_subscribe_user($user, $node, $settings) {
  if (!og_is_group_member($node->nid, $user)) {
    og_save_subscription($node->nid, $user->uid, array(
      'is_active' => (int) $settings['is_active'],
    ));
  }
}