Project

General

Profile

Clear registered users

Added by J Wolfgang Goerlich almost 14 years ago

Hello,

My project is getting a large number of spammers in registered users. These are not active users. How do I delete the spammer accounts?

Thanks,

J Wolfgang Goerlich


Replies (5)

RE: Clear registered users - Added by J Wolfgang Goerlich almost 14 years ago

bump. Anyone know how to remove these spammers?

RE: Clear registered users - Added by Felix Schäfer almost 14 years ago

There's no way to delete users, even deactivate/blocked ones, for now, sorry. There are few other forum topics and issues discussing that with even some SQL samples to delete them, but they are not supported, so use at your own risk.

RE: Clear registered users - Added by J Wolfgang Goerlich almost 14 years ago

Much obliged. I will investigate the unsupported SQL route.

RE: Clear registered users - Added by J Wolfgang Goerlich almost 14 years ago

The steps I followed:

  • Stop Apache, Mongrel, and Subversion services
  • Open MySQL Administration and backup the Redmine database (bitnami_redmine)
  • Open MySQL Query Browser and execute: DELETE FROM bitnami_redmine.users Where Status=2;
  • Restart the services
  • Open Redmine in the web browser and confirm that the spam accounts are gone

RE: Clear registered users - Added by crypto gopher over 2 years ago

Alternatively (and more safely) users can be removed through rails console:

# move to Redmine directory
cd /var/lib/redmine
# make sure bin/rails is executable
chmod +x bin/rails
# execute console under Redmine user
su - redmine
RAILS_ENV=production bin/rails c
# optional: verify registered users count
> User.where(status: User::STATUS_REGISTERED).count
# destroy registered users
> User.where(status: User::STATUS_REGISTERED).destroy_all

This method takes a little more time, but it makes sure that all appropriate callbacks are called during destriction process and so database is left consistent afterwards.

Of course make your backups before executing above steps.

    (1-5/5)