Manual:blockUsers.php

From Linux Web Expert

Revision as of 18:01, 22 May 2023 by imported>Elcapitan68 (Added link to BulkBlock extension in See also section.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.35
<translate> MediaWiki version:</translate>

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 input <translate> Optional</translate>
--performer Username that will be shown in the log entries (does not need to be in the sysop group) <translate> Optional</translate>
--reason Reason for blocks. If empty, no reason will be shown in the logs <translate> Optional</translate>
--reblock Reblock users who are already blocked <translate> Optional</translate>
--expiry Expiry of the block (can be something like "1 week" or a timestamp) <translate> Optional</translate>
--unblock If this option is passed, script will unblock the users instead <translate> Optional</translate>
--allow-createaccount Allow account creation for blocked IPs <translate> Optional</translate>
--allow-email Allow blocked accounts to send emails <translate> Optional</translate>
--allow-talkedit The block user will be able to edit their own talk page <translate> Optional</translate>
--disable-hardblock Don't block logged in accounts from a blocked IP address <translate> Optional</translate>
--disable-autoblock Don't autoblock IP addresses used by the accounts <translate> Optional</translate>

Usage

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

(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