function login_security_form_alter in Login Security 7
Same name and namespace in other branches
- 8 login_security.module \login_security_form_alter()
- 5 login_security.module \login_security_form_alter()
- 6 login_security.module \login_security_form_alter()
- 2.x login_security.module \login_security_form_alter()
Implements hook_form_alter().
File
- ./
login_security.module, line 79 - Login Security
Code
function login_security_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'user_login':
case 'user_login_block':
// Put login_security first or the capture of the previous login
// timestamp won't work and core's validation will update to the current
// login instance before login_security can read the old timestamp.
$validate = array(
'login_security_soft_block_validate',
'login_security_set_login_timestamp',
);
if (isset($form['#validate']) && is_array($form['#validate'])) {
$form['#validate'] = array_merge($validate, $form['#validate']);
}
else {
$form['#validate'] = $validate;
}
$form['#validate'][] = 'login_security_validate';
$form['#submit'][] = 'login_security_submit';
break;
}
}