You are here

function logintoboggan_user_register_validate in LoginToboggan 6

Same name and namespace in other branches
  1. 5 logintoboggan.module \logintoboggan_user_register_validate()
  2. 7 logintoboggan.module \logintoboggan_user_register_validate()

Custom validation function for user registration form

1 string reference to 'logintoboggan_user_register_validate'
logintoboggan_form_alter in ./logintoboggan.module
Implementation of hook_form_alter()

File

./logintoboggan.module, line 428
Logintoboggan Module

Code

function logintoboggan_user_register_validate($form, &$form_state) {

  //Check to see whether our e-mail address matches the confirm address if enabled.
  if (variable_get('logintoboggan_confirm_email_at_registration', 0) && isset($form_state['values']['conf_mail'])) {
    if ($form_state['values']['mail'] != $form_state['values']['conf_mail']) {
      form_set_error('conf_mail', t('Your e-mail address and confirmed e-mail address must match.'));
    }
  }

  //Do some password validation if password selection is enabled.
  if (!variable_get('user_email_verification', TRUE)) {
    $pass_err = logintoboggan_validate_pass($form_state['values']['pass']);
    if ($pass_err) {
      form_set_error('pass', $pass_err);
    }
  }
}