You are here

function lhfingerprintjs2_login_history_detection_results in Login History 7

Implements hook_login_history_detection_results().

File

lhfingerprintjs2/lhfingerprintjs2.module, line 28
fingerprintjs2 support for the Login History module.

Code

function lhfingerprintjs2_login_history_detection_results($login_id, $detection, $old_device_id, $device_id, $account) {
  if (variable_get('lhfingerprintjs2_record_login_data', TRUE)) {
    $fingerprintjs = array_key_exists('fingerprintjs2', $detection) ? $detection['fingerprintjs2'] : '';

    // Use the login_id and save the raw data for later analysis.
    db_insert('lhfingerprintjs2')
      ->fields(array(
      'login_id' => $login_id,
      'fingerprintjs2' => json_encode($fingerprintjs),
    ))
      ->execute();
  }
}