Extension:GlobalBlocking
GlobalBlocking Release status: beta |
|||
---|---|---|---|
![]() |
|||
Implementation | Special page, User identity, API | ||
Description | Allows IP addresses to be blocked on multiple wikis. | ||
Author(s) | Andrew Garrett (Werdnatalk) | ||
MediaWiki | 1.13-alpha and later | ||
License | GPL | ||
Download | |||
|
|||
|
|||
|
|||
Check usage (experimental) |
The GlobalBlocking extension allows a user with the appropriate permissions to block an IP address or IP address range (but not accounts) on all wikis in a group sharing the same globalblocking database. It is intended to be used for combating severe cross-wiki vandalism and spam. Before revision 6899, IPv6 addresses were accepted by the block form, but the blocks were not effective and did not show up in the list of global blocks, unless the default schema of the global blocking database was changed (see below).
Contents |
[edit] Installation instructions
Download the latest snapshot and extract it to your extensions directory.
Add this line to LocalSettings.php:
require_once($IP.'/extensions/GlobalBlocking/GlobalBlocking.php');
You will also need to create a dedicated database for this extension to work. At a minimum (all wikis running on the same host), you need to create a local database called 'globalblocking' (or specify a different name in $wgGlobalBlockingDatabase), and grant all database users that your wikis run as full permissions on that database (at a minimum, SELECT, UPDATE, INSERT, DELETE).
After creating the database, you should import the SQL from globalblocking.sql.
You also need to import the SQL schema in localdb_patches/setup-global_block_whitelist.sql to each of your local wiki databases.
[edit] API
GlobalBlocking adds an API list module "globalblocks" to list globally blocked IP addresses. It is not possible to do the actual blocking via the API.
- Parameters
bgstart
: The timestamp to start enumerating frombgend
: The timestamp to stop enumerating atbgdir
: The direction in which to enumerate (older, newer)bgids
: Pipe-separated list of block IDs to list (optional)bgaddresses
: Pipe-separated list of addresses to search for (optional)bgip
: Get all blocks applying to this IP or CIDR range, including range blocks. (Cannot be used together with bkusers. IPv4 CIDR ranges broader than /16 are not accepted; however, IPv6 ranges can be of any size less than /4)bglimit
: The maximum number of blocks to listbgprop
: Which properties to get (id|address|by|timestamp|expiry|reason|range)
- Example
List all global blocks
<api> <query-continue> <globalblocks bgstart="2009-10-03T12:10:59Z" /> </query-continue> <query> <globalblocks> <block id="2301" address="82.49.115.227" /> <block id="2297" address="59.86.157.24" anononly="" /> <block id="2296" address="83.79.31.175" anononly="" /> <block id="2287" address="81.18.116.66" /> <block id="2286" address="141.223.237.76" /> <block id="2280" address="125.184.11.164" /> <block id="2279" address="124.197.47.74" /> <block id="2278" address="115.139.25.18" /> <block id="2277" address="111.92.160.26" /> <block id="2276" address="89.248.172.146" /> </globalblocks> </query> </api>
[edit] Usage
The following requires appropriate permissions, assigned by default to stewards, which by default can be added or removed by bureaucrats. To make a global block:
- Go to Special:GlobalBlock
- Enter the IPv4 address or range (up to /16) that you wish to block (or any IPv6 address or range up to /4 if you made the schema changes prescribed in the installation instructions section of this page or you have the latest revision), and decide if you want to only block anonymous users. To only block anonymous users, check the checkbox.
- Submit the form. The IP address or range is now globally blocked on your wikis that opt in to the global blocking. Account creation is blocked (even if you selected "anonymous users only": bug 40190), and the blocked IP or range cannot edit any associated user talk pages on any wiki affected and opted in to the global block. If Extension:AbuseFilter is installed, globally blocked IP addresses are prohibited from viewing the abuse log if the particular wiki is opted in to the block.
To remove a global block:
- Go to Special:GlobalBlockList and click "Remove a global block"
- Enter the IP address or range to unblock and the reason, and submit the form. The IP address or range is no longer globally blocked.
[edit] See also
![]() |
This extension is being used on one or more of Wikimedia's wikis. This means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |
- Beta status extensions
- Special page extensions
- User identity extensions
- API extensions
- Extensions in Wikimedia version control
- Extensions which add rights
- GetUserPermissionsErrorsExpensive extensions
- All extensions
- 2012 Q1 Extension Page Review Drive
- Extensions for data exchange with other local wikis
- Extensions used on Wikimedia