Extension:RegexBlock

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.

Installation
Note: this extension works best when used along with setting shared database and memcached.


 * 1) Copy the  folder into the   folder
 * 2) Create the 2 required tables (see schema.sql).
 * 3) Add  to your GlobalSettings.php file.
 * 4) Set $wgSharedDB to the name of a shared database of your choice (in GlobalSettings.php).
 * 5) 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).

Use

 * 1) Go to
 * 2) Enter the IP address or the username to be blocked to the "IP address or username" field
 * 3) Enter an optional reason. If no reason is provided by the blocker, a generic reason will be shown to the blocked user.
 * 4) Select expiry time
 * 5) Select if you want to block the creation of new accounts and if the match needs to be exact or regex one
 * 6) Press "Block this user"

Parameters

 * $wgContactLink &mdash; 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 &mdash; set this to the database to use for blockedby</tt> and stats_blockedby</tt> tables. If you want to use the local database, set this to false</tt>. Otherwise you could set this to $wgSharedDB</tt>, for example.

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</tt>

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</tt> patch against your database.

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.