You are here

function og_user_import_after_save in User Import 5.2

Implementation of hook_user_import_after_save().

File

supported/og.inc, line 92

Code

function og_user_import_after_save($settings, $account, $password, $fields) {
  $groups_selected = $settings['options']['groups'];
  $uid = $account->uid;
  $organic_groups = user_import_get_groups();
  if (empty($organic_groups)) {
    return;
  }
  $og_args = array(
    'is_active' => 1,
    'is_admin' => 0,
    'mail_type' => 0,
    'created' => time(),
  );
  while (list($gid, $title) = each($organic_groups)) {
    if (!empty($groups_selected[$gid])) {
      og_save_subscription($gid, $uid, $og_args);
    }
  }
  return;
}