function regcode_voucher_profiletab_form_submit in Registration codes 7
Same name and namespace in other branches
- 7.2 regcode_voucher/regcode_voucher.module \regcode_voucher_profiletab_form_submit()
Submit handler for regcode_voucher_profiletab_form().
File
- regcode_voucher/
regcode_voucher.module, line 183 - Main code and hooks for regcode voucher module.
Code
function regcode_voucher_profiletab_form_submit($form, $form_state) {
$account = user_load(arg(1));
$code = regcode_code_consume($form_state['values']['regcode_code'], $account->uid);
if (is_object($code)) {
drupal_set_message(check_plain(variable_get('regcode_voucher_message', t('Voucher code used successfully.'))));
}
drupal_goto('user/' . $account->uid);
}