Please upgrade here. These earlier versions are no longer being updated and have security issues.

Banned user management

Hello,
There is a plugin for the management of banned users?
I have thousands of banned users in my forum, I would like to manage them, like removing the ban for some users, or delete them from the database, or delete those with no post and something like it.
There is a plugin for that?
Thank you

«1

Comments

  • hgtonighthgtonight ∞ · New Moderator

    Hmmm... that sounds like a great addition to my BulkEdit plugin. Starred for my next revision.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • So there is nothing like that at the moment??

  • CaylusCaylus ✭✭ ✭✭

    MySQL query to delete all banned users:

    DELETE FROM gdn_user WHERE Banned = 1
    

    Delete all banned users without posts:

    DELETE FROM gdn_user where Banned = 1 AND CountComments < 1 AND CountDiscussions < 1
    

    I think you can delete users from the database directly without too many adverse effects. But I'd wait until someone else chimes in who knows more about the inner workings of Vanilla.

    I'd also recommend making a backup of your database before you start editing it.

  • hgtonighthgtonight ∞ · New Moderator

    @Caylus said:

    I think you can delete users from the database directly without too many adverse effects. But I'd wait until someone else chimes in who knows more about the inner workings of Vanilla.

    This is only true if you also remove all associated content when you do the ban.

    I'd also recommend making a backup of your database before you start editing it.

    :+1:

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • CaylusCaylus ✭✭ ✭✭

    Ah, I tried removing an user from the database before I posted and didn't get any errors. Posts of them just became associated with "unknown".

    Is there any catastrophic thing that can happen if users suddenly disappear?

  • hgtonighthgtonight ∞ · New Moderator

    @Caylus said:
    Ah, I tried removing an user from the database before I posted and didn't get any errors. Posts of them just became associated with "unknown".

    Is there any catastrophic thing that can happen if users suddenly disappear?

    The main thing is database inconsistency (essentially orphan records). Plugins can potentially break if there is a dangling user id.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    Caylus
  • Thank you for this informations, but I have a very active forum, I would not risk that some plugins may no longer work or generate some fatal error.

    I hope in some update

  • hgtonighthgtonight ∞ · New Moderator

    @matamata said:
    Thank you for this informations, but I have a very active forum, I would not risk that some plugins may no longer work or generate some fatal error.

    I hope in some update

    1. Clone your site to a local server
    2. Experiment
    3. Once successful implement on your production site
    4. Profit!

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

    Caylus
  • matamatamatamata New New
    edited February 2017

    Thanks, I'm already trying locally, migration've done.

    The query does not work:

    DELETE FROM WHERE gdn_user Banned = 1 AND CountComments <1 AND CountDiscussions <1;
    / * Rows affected: 0 Rows found: 0 Warnings: 0 Duration of 1 query: 0.234 sec. * /
    
  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Look at your query.

    DELETE

    FROM ????? you haven't defined the table

    WHERE gdn_user Banned = 1 AND CountComments <1 AND CountDiscussions <1;

    hgtonight
  • matamatamatamata New New
    edited February 2017

    You're right, I copied the query from a previous post, I did not realize the error.
    But even with the correct query works:

        DELETE FROM gdn_user WHERE Banned = 1 AND CountComments <1 AND CountDiscussions <1;
        / * Rows affected: 0 Rows found: 0 Warnings: 0 Duration of 1 query: 0.203 sec. * /
    
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    CountComments and CountDiscussions might be NULL and you have strict mode enabled?


    Caylushgtonight
  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Is your table gdn_user or is it GDN_User?

  • My table is gdn_user

    But i tested both with gdn_user and GDN_user

  • CaylusCaylus ✭✭ ✭✭

    @R_J said:
    CountComments and CountDiscussions might be NULL and you have strict mode enabled?

    ^^ This. Could you try:
    DELETE FROM gdn_user WHERE Banned = 1 AND CountComments = NULL AND CountDiscussions = NULL

  • matamatamatamata New New
    edited February 2017

    Still nothing

    DELETE FROM gdn_user WHERE Banned = 1 AND CountComments = NULL AND CountDiscussions = NULL;
    / * Rows affected: 0 Rows found: 0 Warnings: 0 Duration of 1 query: 0.235 sec. * /
    DELETE FROM GDN_User WHERE Banned = 1 AND CountComments = NULL AND CountDiscussions = NULL;
    / * Rows affected: 0 Rows found: 0 Warnings: 0 Duration of 1 query: 0.203 sec. * /
    
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Could you just please confirm with a SELECT COUNT(UserID) FROM GDN_User WHERE Banned = 1 that there are still banned users?

    And afterwards

    SELECT DISTINCT CountComments, CountDiscussions
    FROM GDN_User
    WHERE Banned = 1
    

    to see what we could delete...


  • Check this screenshot

    http://imgur.com/a/H7xeD

  • CaylusCaylus ✭✭ ✭✭

    Could you scroll down in that second query (with 293 results) if you see any 0 or NULLs?

  • You mean the fourth query with 393 results?
    In the second query there are 0 results
    Nowhere I have 293

    I find 0 or null nowhere

    http://imgur.com/a/q39O0

Sign In or Register to comment.