You are here

function _login_security_add_event in Login Security 8

Same name and namespace in other branches
  1. 6 login_security.module \_login_security_add_event()
  2. 7 login_security.module \_login_security_add_event()
  3. 2.x login_security.module \_login_security_add_event()

Save the login attempt in the tracking database: user name nd ip address.

Parameters

string $name: User name to be tracked.

string $ip: IP Address of the pair.

1 call to _login_security_add_event()
login_security_set_login_timestamp in ./login_security.module
Save login attempt and save login/access timestamps.

File

./login_security.module, line 330
Login Security module hooks.

Code

function _login_security_add_event($name, $ip) {

  // Each attempt is kept for future mining of advanced brute forcing like
  // multiple IP or X-Forwarded-for usage and automated track data cleanup.
  db_insert('login_security_track')
    ->fields([
    'host' => $ip,
    'name' => $name,
    'timestamp' => REQUEST_TIME,
  ])
    ->execute();
}