You are here

function recovery_pass_form_alter in Recovery Password (Email New Password) 7

Same name and namespace in other branches
  1. 8 recovery_pass.module \recovery_pass_form_alter()

Implements hook_form_alter().

File

./recovery_pass.module, line 185
Alters default Drupal password recovery process by overriding default submit.

Code

function recovery_pass_form_alter(&$form, &$form_state, $form_id) {
  if (variable_get('recovery_pass_old_pass_show', 1)) {
    switch ($form_id) {
      case 'user_login_block':
      case 'user_login':

        // Extending default drupal login validators.
        $insert = 'recovery_pass_user_login_validate';
        $form['#validate'] = _recovery_pass_insert_array($form['#validate'], 1, $insert);
        break;
    }
  }
}