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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

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.

jbrown’s picture

I totally agree.

Dries’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

Berdir’s picture

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 :)

Berdir’s picture

Erm, with patch this time.

webchick’s picture

Status: Needs review » Fixed

Oopsie. :P

Committed to HEAD.

jbrown’s picture

Status: Fixed » Needs review
FileSize
3.99 KB

I implemented the suggestion in #4.

ff1’s picture

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

neale.wolfson’s picture

Version: 7.x-dev » 8.0.x-dev
Assigned: moshe weitzman » Unassigned
Issue summary: View changes
Status: Needs review » Needs work

Looks OK, but needs to match to code formatting standards (Curly brackets always and no empty lines with whitespace).
Needs a reroll for GIT.

This is still an issue in D8.

zaporylie’s picture

Status: Needs work » Closed (cannot reproduce)
Issue tags: +drupaldevdays

This is not an issue any more, at least I can't reproduce it. All eventual code standard problems will be solved in https://www.drupal.org/node/1518116