function _login_security_remove_events in Login Security 6
Same name and namespace in other branches
- 8 login_security.module \_login_security_remove_events()
- 7 login_security.module \_login_security_remove_events()
- 2.x login_security.module \_login_security_remove_events()
Remove tracked events or expire old ones.
Parameters
$name: if specified, events for this user name will be removed.
$host: if specified, IP Address of the name-ip pair to be removed.
3 calls to _login_security_remove_events()
- login_security_cron in ./
login_security.module - Implementation of hook_cron().
- login_security_user in ./
login_security.module - Implementation of hook_user().
- login_security_validate in ./
login_security.module - Implementation of form validate. This functions does more than just validating, but it's main Intention is to break the login form flow.
File
- ./
login_security.module, line 238 - Login Security
Code
function _login_security_remove_events($name = NULL, $host = NULL) {
// Remove selected events
if (!empty($name)) {
if (!empty($host)) {
db_query("DELETE FROM {login_security_track} WHERE name = '%s' AND host = '%s'", $name, $host);
}
else {
db_query("DELETE FROM {login_security_track} WHERE name = '%s'", $name);
}
}
else {
// Calculate protection time window and remove expired events
$time = time() - variable_get('login_security_track_time', LOGIN_SECURITY_TRACK_TIME) * 3600;
_login_security_remove_all_events($time);
}
return;
}