My wiki collected a lot of spam over the past few months, so I've blocked it to only registered users. Unfortunately I never turned off user registration. Is it possible to block a lot of user accounts at once, or should I just restart?

link|improve this question
Do you mean delete the user accounts? – Shane Madden Jan 3 at 23:41
That would work for me. I think MediaWiki may philosophically be designed to favor blocking over deletion. – Chris Jan 4 at 21:29
feedback

1 Answer

The quickest and least invasive way to prevent a big list of registered users from making modifications is probably to do a bulk password change for the unwelcome users.

Assuming you're running a Unix-like, and that the list of folks you want to keep is relatively low:

eg., for MySQL:

mysql -p -u root -B wikidb -e 'select user_name from user;' | tee user.list
  • Remove the users you want to keep from the user.list file.

  • Use the MediaWiki password command-line tool to change passwords to something random.

eg.

cd [wiki-docroot]/maintenance/
while read wikiuser; do 
    echo $wikiuser; 
    php ./changePassword.php $wikiuser BOGUS%PASSblahblah77; 
done <user.list

Generating a different password for each user is left as an exercise for the reader. :-)

link|improve this answer
Interesting way to do it. It's very cool to see how flexible shell scripts can be. EDIT: found it, a list of command line tools is here: mediawiki.org/wiki/Manual:Maintenance_scripts – Chris Jan 4 at 21:32
Yep, a nice list of command-line tools there. Too bad there isn't a bulk password changer among them. – Royce Williams Jan 5 at 3:01
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.