You are here

function _seckit_form_alter_login_form in Security Kit 8

Same name and namespace in other branches
  1. 7 seckit.module \_seckit_form_alter_login_form()
  2. 2.x seckit.module \_seckit_form_alter_login_form()

Form alteration helper for user login forms.

2 calls to _seckit_form_alter_login_form()
seckit_form_user_login_form_alter in ./seckit.module
Implements hook_form_FORM_ID_alter().
seckit_form_user_register_form_alter in ./seckit.module
Implements hook_form_FORM_ID_alter().

File

./seckit.module, line 27
Allows administrators to improve security of the website.

Code

function _seckit_form_alter_login_form(&$form, FormStateInterface &$form_state) {
  $config = \Drupal::config('seckit.settings');
  if ($config
    ->get('seckit_various.disable_autocomplete')) {
    $form['#attributes']['autocomplete'] = 'off';
    if (isset($form['pass'])) {
      $form['pass']['#attributes']['autocomplete'] = 'off';
    }
  }
}