You are here

function regcode_voucher_submit in Registration codes 6

Same name and namespace in other branches
  1. 6.2 regcode_voucher/regcode_voucher.module \regcode_voucher_submit()

Submit handler

File

regcode_voucher/regcode_voucher.module, line 169

Code

function regcode_voucher_submit($form, $form_state) {
  $edit = $form_state['values'];
  $account = $GLOBALS['user'];

  // Simulate creating a new user
  regcode_user('insert', $edit, $account);

  // Redirect
  drupal_set_message(check_plain(variable_get('regcode_voucher_message', 'Voucher code used successfully.')));
  drupal_goto('user');
}