function recovery_pass_form_alter in Recovery Password (Email New Password) 8
Same name and namespace in other branches
- 7 recovery_pass.module \recovery_pass_form_alter()
Implements hook_form_alter().
File
- ./
recovery_pass.module, line 153 - Contains module code.
Code
function recovery_pass_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$config = \Drupal::config('recovery_pass.settings')
->get('old_pass_show');
if ($config) {
switch ($form_id) {
case 'user_login_form':
// Extending default drupal login validators.
$insert = '_recovery_pass_user_login_validate';
$form['#validate'] = _recovery_pass_insert_array($form['#validate'], 1, $insert);
break;
}
}
}