Deleting an account and pms

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Pikachew
Registered User
Posts: 3
Joined: Tue Feb 19, 2019 6:52 pm

Deleting an account and pms

Post by Pikachew »

Someone spammed images through pm on my forum, if I delete the account will the pms be deleted if they were read by the receiver or only unread messages? and will it be deleted in the database? the images were posted through the attachment button if that matters
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52768
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Deleting an account and pms

Post by stevemaury »

You could do a quick test with a test user, but I do not believe attachments are affected at all by deleting a user, except if you also choose to delete a users posts, the attachments to those posts will effectively be unreachable.

If it were me, I would delete the user and their posts, and then make a backup of any remaining data for attachments in PMs by running this query and exporting its output to an sql file. This is in case the running of the second query below gives unexpected result, the table can be restored to its former state by importing the sql file:

Code: Select all

SELECT * FROM phpbb_attachments WHERE poster_id = X AND in_message > 0
If your table prefix is not phpbb_ change accordingly. X is the user_id of the spammer.

Then, run this query:

Code: Select all

DELETE FROM phpbb_attachments WHERE poster_id = X AND in_message > 0
The attachment will remain in the /files folder, but cannot be seen. Attempts to view it will probably throw an error.
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
Pikachew
Registered User
Posts: 3
Joined: Tue Feb 19, 2019 6:52 pm

Re: Deleting an account and pms

Post by Pikachew »

Thanks so much for the reply, so attachments in posts would be deleted but not pm's? what if the user who received the message deleted the post as well, then would the attachment be removed from the database too? It's using up a lot of space...
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Deleting an account and pms

Post by 3Di »

ACP administer user
Attachments
delete_attachs.png
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Deleting an account and pms

Post by canonknipser »

Pikachew wrote: Tue Feb 19, 2019 8:06 pm then would the attachment be removed from the database too? It's using up a lot of space...
Attachments are NOT stored in the database, only a reference row with some metadata. The attachments are stores in the files-folder.

And if a pm is deleted from both sender and receiver(s), all information including attachment files and attachment data are deleted also.
For normal posts, as stevemaury already explained, attachments are only deleted if user's posts are deleted.

You can always delete users attachments from the acp in the user management, select "attachments" in the dropdown in top right corner when you navigated to "Users and Groups" - "Manage Users" and selected the specific user. Attachments from deleted users should belong to the guest account.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
Pikachew
Registered User
Posts: 3
Joined: Tue Feb 19, 2019 6:52 pm

Re: Deleting an account and pms

Post by Pikachew »

canonknipser wrote: Tue Feb 19, 2019 10:12 pm
Pikachew wrote: Tue Feb 19, 2019 8:06 pm then would the attachment be removed from the database too? It's using up a lot of space...
Attachments are NOT stored in the database, only a reference row with some metadata. The attachments are stores in the files-folder.

And if a pm is deleted from both sender and receiver(s), all information including attachment files and attachment data are deleted also.
For normal posts, as stevemaury already explained, attachments are only deleted if user's posts are deleted.

You can always delete users attachments from the acp in the user management, select "attachments" in the dropdown in top right corner when you navigated to "Users and Groups" - "Manage Users" and selected the specific user. Attachments from deleted users should belong to the guest account.
Sorry last nooby question ;) if you delete the attachments from the acp will that delete them in pm's that have been sent? Or will it basically do what deleting the account does?
Post Reply

Return to “[3.2.x] Support Forum”