You are here

function logintoboggan_user_register_validate in LoginToboggan 5

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

Custom validation function for user registration form

File

./logintoboggan.module, line 413
Logintoboggan Module

Code

function logintoboggan_user_register_validate($form_id, $form_values) {

  //Check to see whether our e-mail address matches the confirm address if enabled.
  if (!user_access('administer users') && variable_get('email_reg_confirm', 0)) {
    if ($form_values['mail'] != $form_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_values['pass']);
    if ($pass_err) {
      form_set_error('pass', $pass_err);
    }
  }
}