Download & Extend

Preserve watchdog entries during user cancel

Project:Drupal core
Version:7.x-dev
Component:dblog.module
Category:bug report
Priority:normal
Assigned:moshe weitzman
Status:needs review

Issue Summary

For some unholy reason, we delete all watchdog entries when a user cancels own account. Thats a security nightmare. Someone can wreak havoc and then cover all their tracks. Attached patch removes these watchdog deletes and smartens our dblog report to show rows where the uid is no longer found.

AttachmentSizeStatusTest resultOperations
dblog.diff1.39 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch dblog.diff.View details | Re-test

Comments

#1

Status:needs review» reviewed & tested by the community

I think the idea is that people can completely remove their accounts from the system, but since logs get cleared by cron, and contrib could add this hook, I agree it's madness doing it like this. Also clearing watchdog logs can be an expensive operation if there's a lot of rows so best left for cron.

Patch looks great, needs a testbot (or manual) run before commit.

#2

I totally agree.

#3

Priority:critical» normal
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks!

#4

Component:user system» dblog.module
Status:fixed» needs review

Poor tests... everyone is forgetting these :) The attached page removes the tests that test this.

Another thing I noticed: Those events then show up as Anonymous, but link to the profile page of the deleted user. Maybe we should add something like "Deleted user (uid: 27)" instead?

Not covered by the patch, we need to get HEAD to pass again first :)

#5

Erm, with patch this time.

AttachmentSizeStatusTest resultOperations
remove_user_cancel_tests.patch1.83 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch remove_user_cancel_tests.patch.View details | Re-test

#6

Status:needs review» fixed

Oopsie. :P

Committed to HEAD.

#7

Status:fixed» needs review

I implemented the suggestion in #4.

AttachmentSizeStatusTest resultOperations
deleted_user.patch3.99 KBIdlePASSED: [[SimpleTest]]: [MySQL] 22,942 pass(es).View details | Re-test

#8

#7: deleted_user.patch queued for re-testing.

nobody click here