You are here

function _login_security_remove_all_events in Login Security 8

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

Remove all tracked events up to a date..

Parameters

int $time: if specified, events up to this timestamp will be deleted. If not specified, all elements up to current timestamp will be deleted.

Return value

int The number of events deleted.

2 calls to _login_security_remove_all_events()
LoginSecurityAdminSettings::cleanTrackedEvents in src/Form/LoginSecurityAdminSettings.php
Submit handler to clean the login_security_track table.
_login_security_remove_events in ./login_security.module
Remove tracked events or expire old ones.

File

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

Code

function _login_security_remove_all_events($time = NULL) {

  // Remove selected events.
  if (empty($time)) {
    $time = REQUEST_TIME;
  }
  return db_delete('login_security_track')
    ->condition('timestamp', $time, '<')
    ->execute();
}