Extension:RegexBlock
From MediaWiki.org
|
RegexBlock Release status: stable |
|
|---|---|
| Implementation | User rights, Special page |
| Description | Gives users with permissions to block, view and unblock user names and IP addresses by given name, using regular expressions |
| Author(s) | Bartek Łapiński |
| Download | SVN README |
| Added rights | regexblock |
RegexBlock is an extension 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 andregexBlock.phpinto the/extensionsfolder - Add
require_once ("/extensions/regexBlock/regexBlock.php");to your GlobalSettings.php file. - Create required tables.
- 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).
Depending on your previous configuration, you may need to remove or comment a line including the older regexBlock.php (probably in your GlobalSettings.php file).
Requires a total of 2 tables to be created.
[edit] SQL queries to create the 2 tables
CREATE TABLE `blockedby` ( `blckby_id` int(5) NOT NULL AUTO_INCREMENT, `blckby_name` varchar(255) NOT NULL, `blckby_blocker` varchar(255) NOT NULL, `blckby_timestamp` char(14) NOT NULL, `blckby_expire` char(14) NOT NULL, `blckby_create` tinyint(1) NOT NULL DEFAULT '1', `blckby_exact` tinyint(1) NOT NULL DEFAULT '0', `blckby_reason` tinyblob NOT NULL, PRIMARY KEY (`blckby_id`), UNIQUE KEY `blckby_name` (`blckby_name`), KEY `blckby_timestamp` (`blckby_timestamp`), KEY `blckby_expire` (`blckby_expire`) );
CREATE TABLE `stats_blockedby` ( `stats_id` int(8) NOT NULL AUTO_INCREMENT, `stats_user` varchar(255) NOT NULL, `stats_blocker` varchar(255) NOT NULL, `stats_timestamp` char(14) NOT NULL, `stats_ip` char(15) NOT NULL, PRIMARY KEY (`stats_id`), KEY `stats_timestamp` (`stats_timestamp`) );
[edit] Use
- Go to
Special:Regexblock - Enter the IP address or the username to be blocked to the "IP Adress or username" field
- Enter an optional reason
- Select expiry time
- Select if you want to block the creation of new accounts and if the match needs to be exact
- Press "Block this user"
[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.

