You are here

function og_workflow_ng_action_subscribe_user in Organic groups 5.8

Same name and namespace in other branches
  1. 5 og_workflow_ng.inc \og_workflow_ng_action_subscribe_user()
  2. 5.3 og_workflow_ng.inc \og_workflow_ng_action_subscribe_user()

Action: Subscribe user to group.

File

./og_workflow_ng.inc, line 105
workflow_ng integration for og module.

Code

function og_workflow_ng_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'],
    ));
  }
}