Extension:RegexBlock
From MediaWiki.org
|
Release status: stable |
|||
|---|---|---|---|
| Implementation | User rights, Special page | ||
| Description | Adds a new special page for blocking, viewing and unblocking user names and IP addresses by given name, using regular expressions | ||
| Author(s) | Bartek Łapiński, Tomasz Klim, Piotr Molski, Adrian Wieczorek, Alexandre Emsenhuber, Jack Phoenix | ||
| Last Version | 1.2.1 (13th of March, 2009) | ||
| MediaWiki | 1.11+ | ||
| License | GNU General Public License 2.0 or later | ||
| Download | SVN README |
||
|
|||
|
|||
|
|||
|
check usage (experimental) |
|||
RegexBlock is an extension that adds special page with the interface for blocking, viewing and unblocking user names and IP addresses using regular expressions. It was originally written by Bartek Łapiński for Wikia.
Contents |
[edit] Installation
Note: this extension works best when used along with setting shared database and memcached.
- Copy the
/regexBlockfolder into the$IP/extensionsfolder - Create the 2 required tables (see schema.sql).
- Add
require_once("$IP/extensions/regexBlock/regexBlock.php");to your GlobalSettings.php file. - Set $wgSharedDB to the name of a shared database of your choice (in GlobalSettings.php).
- Set $wgMainCacheType to 'CACHE_MEMCACHED' and $wgMemCachedServers. The latter could look like this: $wgMemCachedServers = array ("127.0.0.1:11000"); (for a memcached server running on IP 127.0.0.1 and port 11000).
[edit] Use
- Go to
Special:RegexBlock - Enter the IP address or the username to be blocked to the "IP address or username" field
- Enter an optional reason. If no reason is provided by the blocker, a generic reason will be shown to the blocked user.
- Select expiry time
- Select if you want to block the creation of new accounts and if the match needs to be exact or regex one
- Press "Block this user"
[edit] Parameters
- $wgContactLink — displayed to regexblocked users in the regexblock-reason-* interface messages. The default value is Special:Contact, but you might want to customize it if ContactPage extension isn't installed on your wiki.
- $wgRegexBlockDatabase — set this to the database to use for blockedby and stats_blockedby tables. If you want to use the local database, set this to false. Otherwise you could set this to $wgSharedDB, for example.
[edit] Examples
To block all users except local ones (192.168.xx.xx): \b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?([0]|[2-9])[0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
[edit] Note for users using pre-1.2 version
If you are upgrading from a pre-1.2 (r45428) version of regexBlock, you'll need to apply the patch-upgrade.sql patch against your database.
[edit] Licensing and downloads
The extension is available under the GNU General Public License 2.0 or later, and can be downloaded from Subversion, or accessed via the web-based viewer.
The software is provided as-is. Updates will be made according to the needs of Wikimedia wikis; or where critical vulnerabilities are discovered.