login_security.install in Login Security 7
Same filename and directory in other branches
Login Security installation routines.
File
login_security.installView source
<?php
/**
* @file
* Login Security installation routines.
*/
/**
* Implements hook_schema().
*/
function login_security_schema() {
$schema['login_security_track'] = array(
'description' => 'Keeps track of failed login attempts, as a pair of the IP address and user name.',
'fields' => array(
'id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => "ID of each login event.",
),
'host' => array(
'type' => 'varchar',
'length' => 39,
'not null' => TRUE,
'default' => '',
'description' => "The IP address of the request.",
),
'name' => array(
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
'description' => "Clean username, submitted using the login form.",
),
'timestamp' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "Timestamp of the event.",
),
),
'indexes' => array(
'name' => array(
'name',
),
'host' => array(
'host',
),
'timestamp' => array(
'timestamp',
),
),
'primary key' => array(
'id',
),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
function login_security_uninstall() {
variable_del('login_security_track_time');
variable_del('login_security_user_wrong_count');
variable_del('login_security_host_wrong_count');
variable_del('login_security_host_wrong_count_hard');
variable_del('login_security_disable_core_login_error');
variable_del('login_security_notice_attempts_available');
variable_del('login_security_notice_attempts_message');
variable_del('login_security_host_soft_banned');
variable_del('login_security_host_hard_banned');
variable_del('login_security_user_blocked');
variable_del('login_security_user_blocked_email_user');
variable_del('login_security_user_blocked_email_subject');
variable_del('login_security_user_blocked_email_body');
variable_del('login_security_last_login_timestamp');
variable_del('login_security_last_access_timestamp');
variable_del('login_security_activity_threshold');
variable_del('login_security_login_activity_email_user');
variable_del('login_security_login_activity_subject');
variable_del('login_security_login_activity_body');
variable_del('login_security_threshold_notified');
}
/**
* Remove the option to have a login punishment for login failures for DoS.
*/
function login_security_update_7001() {
variable_del('login_security_delay_base_time');
variable_del('login_security_delay_increase');
}
Functions
Name | Description |
---|---|
login_security_schema | Implements hook_schema(). |
login_security_uninstall | Implements hook_uninstall(). |
login_security_update_7001 | Remove the option to have a login punishment for login failures for DoS. |