Form builder; the main user login form.
function user_login_form($form, &$form_state) {
// Display login form:
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Username'),
'#size' => 60,
'#maxlength' => USERNAME_MAX_LENGTH,
'#description' => t('Enter your @s username.', array(
'@s' => config('system.site')
->get('name'),
)),
'#required' => TRUE,
'#attributes' => array(
'autocorrect' => 'off',
'autocapitalize' => 'off',
'spellcheck' => 'false',
'autofocus' => 'autofocus',
),
);
$form['pass'] = array(
'#type' => 'password',
'#title' => t('Password'),
'#size' => 60,
'#description' => t('Enter the password that accompanies your username.'),
'#required' => TRUE,
);
$form['actions'] = array(
'#type' => 'actions',
);
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Log in'),
);
$form['#validate'] = user_login_default_validators();
return $form;
}