summaryrefslogtreecommitdiff
path: root/modules/dblog/dblog.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/dblog/dblog.module')
-rw-r--r--modules/dblog/dblog.module14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module
index e272c75bf..1430d20cb 100644
--- a/modules/dblog/dblog.module
+++ b/modules/dblog/dblog.module
@@ -101,10 +101,18 @@ function dblog_cron() {
}
/**
- * Implementation of hook_user_delete().
+ * Implementation of hook_user_cancel().
*/
-function dblog_user_delete(&$edit, &$user) {
- db_query('UPDATE {watchdog} SET uid = 0 WHERE uid = %d', $user->uid);
+function dblog_user_cancel(&$edit, &$account, $method) {
+ switch ($method) {
+ case 'user_cancel_reassign':
+ db_update('watchdog')->fields(array('uid' => 0))->condition('uid', $account->uid)->execute();
+ break;
+
+ case 'user_cancel_delete':
+ db_delete('watchdog')->condition('uid', $account->uid)->execute();
+ break;
+ }
}
function _dblog_get_message_types() {