You are here

function ip_anon_scrub in IP Anonymize 7

Same name and namespace in other branches
  1. 8 ip_anon.inc \ip_anon_scrub()

Anonymize IP addresses which have exceeded the retention period.

1 call to ip_anon_scrub()
ip_anon_cron in ./ip_anon.module
Implements hook_cron().

File

./ip_anon.inc, line 11
Page callbacks and utility functions for IP Anonymize module.

Code

function ip_anon_scrub() {
  foreach (ip_anon_tables() as $table => $columns) {
    db_update($table)
      ->fields(array(
      $columns['hostname'] => 0,
    ))
      ->condition($columns['timestamp'], REQUEST_TIME - variable_get("ip_anon_period_{$table}", 21600), '<')
      ->execute();
  }
}