You are here

function inline_registration_validate in Inline Registration 7

Same name and namespace in other branches
  1. 5 inline_registration.module \inline_registration_validate()
  2. 6 inline_registration.module \inline_registration_validate()

Validation routine for inline registration form.

1 string reference to 'inline_registration_validate'
inline_registration_form_alter in ./inline_registration.module
Implements hook_form_alter().

File

./inline_registration.module, line 114
Allow anonymous users to register via the node/add page.

Code

function inline_registration_validate($form, &$form_state) {

  // For some reason the name is empty and a scrypt works
  // incorrectly so copy it from other variable.
  $form_state['values']['name'] = $form_state['input']['name'];

  // If we integrated with email_registration, name won't be there.
  if (module_exists('email_registration') && !isset($form_state['input']['name'])) {
    $form_state['values']['name'] = $form_state['input']['mail'];
  }
  else {

    // For some reason the name is empty and a script works
    // incorrectly so copy it from other variable.
    $form_state['values']['name'] = $form_state['input']['name'];
  }
  unset($form_state['uid']);
  if (module_exists('logintoboggan')) {
    logintoboggan_user_register_validate($form['register']['form'], $form_state);
  }
  else {

    // Validate using user module's validation routine.
    user_account_form_validate($form['register']['form'], $form_state);
  }
}