function ip_anon_cron_run in IP Anonymize 6
Anonymize IP addresses which have exceeded the retention period.
1 call to ip_anon_cron_run()
- ip_anon_cron in ./
ip_anon.module - Implementation of hook_cron().
File
- ./
ip_anon.pages.inc, line 11 - Page callbacks and utility functions for IP anonymize module.
Code
function ip_anon_cron_run() {
if (variable_get('ip_anon_policy', 0)) {
foreach (ip_anon_tables() as $table => $columns) {
db_query("UPDATE {{$table}} SET {$columns['hostname']} = '%s' WHERE {$columns['timestamp']} < %d", 0, time() - variable_get('ip_anon_period_' . $table, 10800));
}
}
}