MediaWiki version:
1.35
MediaWiki file: blockUsers.php
Location: maintenance/
Source code: master 1.40.0 1.39.4 1.35.11
Classes: BlockUsers

Details

blockUsers.php file is a maintenance script to block or unblock a batch of users.

By default, all users are hard blocked, auto blocked from any current and subsequent IP addresses, email disabled, unable to write to their user page and unable to create further accounts with no expiry to this block. You can change these configuration through options.

Options/Arguments

Option/Argument Description Required?
<file> A file where each line contains the name of a user to be blocked. If not given, script reads from standard inputOptional
--performer Username that will be shown in the log entries (does not need to be in the sysop group)Optional
--reason Reason for blocks. If empty, no reason will be shown in the logsOptional
--reblock Reblock users who are already blockedOptional
--expiry Expiry of the block (can be something like "1 week" or a timestamp)Optional
--unblock If this option is passed, script will unblock the users insteadOptional
--allow-createaccount Allow account creation for blocked IPsOptional
--allow-email Allow blocked accounts to send emailsOptional
--allow-talkedit The block user will be able to edit their own talk pageOptional
--disable-hardblock Don't block logged in accounts from a blocked IP addressOptional
--disable-autoblock Don't autoblock IP addresses used by the accountsOptional

Usage

php maintenance/blockUsers.php [ <file>| --performer| --reason| --reblock| --expiry| --unblock| --allow-createaccount| --allow-email| --allow-talkedit| --disable-hardblock| --disable-autoblock ]
Terminal
$ php maintenance/blockUsers.php userlist.txt --performer "Foo" --reason "Vandalism"

Blocking 'A' succeeded.
Blocking ‘C’ succeeded.
Blocking 'Bar' failed (There is no user by the name "Bar". Check your spelling.).

(This will block the users contained in the text file "userlist.txt")

If the filename is omitted, the script will expect a list of users on the standard input.

See also

  • Manual:Block and unblock
  • cleanupSpam.php
  • Extension:GlobalBlocking
  • BulkBlock Extension — an extension that allows administrators to easily block multiple users at once on a MediaWiki website.
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.