You are here

function _group_ui_user_operations_set_state in Organic groups 7

Set the state of a user in a group.

Parameters

$gid: Group ID

$uids: Uset IDs

$state: The state to set the user in the group.

2 calls to _group_ui_user_operations_set_state()
og_ui_user_operations_approve in og_ui/og_ui.module
Callback function for admin mass approving users.
og_ui_user_operations_block in og_ui/og_ui.module
Callback function for admin mass blocking users.

File

og_ui/og_ui.module, line 614
Organic groups UI.

Code

function _group_ui_user_operations_set_state($gid, $uids, $state) {
  $accounts = user_load_multiple($uids);
  foreach ($accounts as $account) {
    $values = array(
      'entity' => $account,
      'state' => $state,
    );
    og_group($gid, $values);
  }
}