You are here

function uif_import_form_submit in User Import Framework 6

Same name and namespace in other branches
  1. 7 uif.admin.inc \uif_import_form_submit()

Form submission handler.

File

./uif.admin.inc, line 123
Simple, extensible user import from a CSV file.

Code

function uif_import_form_submit($form, &$form_state) {
  $step = empty($form_state['storage']['step']) ? 1 : $form_state['storage']['step'];
  if (1 == $step) {
    $form_state['storage']['notify'] = isset($form_state['values']['notify']) ? $form_state['values']['notify'] : FALSE;
    $preview_count = $form_state['values']['preview_count'];
    if ($preview_count) {
      $form_state['storage']['preview_count'] = $preview_count;
      $form_state['storage']['user_preview'] = theme('uif_preview_users', $form_state['storage']['data'], $preview_count);
    }
    else {
      $step = 2;
    }
  }
  if (2 == $step) {
    uif_batch_import_users($form_state);
  }
  $form_state['storage']['step'] = $step + 1;
}