From 5885925b0d2881277c22c6d70d86f1bc060fb133 Mon Sep 17 00:00:00 2001 From: Gerhard Killesreiter Date: Sun, 26 Mar 2006 19:31:00 +0000 Subject: #53348, Handling of deleted/blocked user accounts, patch by jreyero and Zen --- modules/statistics.module | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules/statistics.module') diff --git a/modules/statistics.module b/modules/statistics.module index 9eaccd6fe..1c79db602 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -145,6 +145,15 @@ function statistics_menu($may_cache) { return $items; } +/** + * Implementation of hook_user(). + */ +function statistics_user($op, &$edit, &$user) { + if ($op == 'delete') { + db_query('UPDATE {accesslog} SET uid = 0 WHERE uid = %d', $user->uid); + } +} + function statistics_access_log($aid) { $result = db_query('SELECT a.*, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE aid = %d', $aid); if ($access = db_fetch_object($result)) { -- cgit v1.2.3