حذف حسابي عبر وحدة التحكم

Hi!

I have a weird issue with a Discourse forum, and I didn’t fine a solution by myself: I installed a forum, I have access to the console but I don’t run it. I asked to the current admin to delete my account because I don’t want to be involve in this mess, but he refuses.

Usually I would be fine letting my account in a forum without using it, but the admin like to Impersonate every account (like mine, or discobot) to post weird stuff, and I really don’t like it. I tried to talk some sense with this person but I don’t trust him at all.

I would prefer to delete my account permanently. I didn’t find a way via Discourse with an admin account, or even a developper’s account (with the function Impersonate) to do it properly.

Is there a way to do it with the console, without messing up the database?

I know the basic stuff (./launcher enter app then rails c) but not the exact command to do.

Thanks, it would relieve me a lot!

إعجاب واحد (1)

@neil mentioned this command in a message earlier today. I’d wait for him to confirm this does what you’d like, and you’ll likely need to modify the command:

UserDestroyer.new(neil).destroy(user, delete_posts: true)
7 إعجابات

Yes that command will do it. If you want the system user to do it:

UserDestroyer.new(Discourse.system_user).destroy(User.find_by_username('...'), delete_posts: true)
6 إعجابات

I thought an admin could not impersonate another admin user?

إعجاب واحد (1)

Thanks neil I’ll try tonight :+1:

@michaeld : I wasn’t a developper account at the time, he could’ve demoted me during his jokes

إعجاب واحد (1)

Admins can’t demote other admins.
And you also say

which is impossible as well… weird story.

I just checked and a admin with developer access can impersonate anyone, including admin accounts

edit: worked perfectly, thanks @neil and @jomaxro - this is a relieve

6 إعجابات

This topic was automatically closed after 2284 days. New replies are no longer allowed.