Extension:LockDownEnglishPages

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.svg
Lock Down English Pages

Release status:Extension status beta

ImplementationTemplate:Extension#type User rights
DescriptionTemplate:Extension#description Prevents non-staff users from editing the English interface messages
Author(s)Template:Extension#username Jack Phoenix
Latest versionTemplate:Extension#version 0.1 (2011-07-06)
MediaWikiTemplate:Extension#mediawiki 1.6.0+
LicenseTemplate:Extension#license Public domain
Download
ExampleTemplate:Extension#example ShoutWiki's Interface Messages Wiki
Hooks usedTemplate:Extension#hook
userCanManual:Hooks/userCan

Translate the LockDownEnglishPages extension if it is available at translatewiki.net

Check usage and version matrix.

Lock Down English Pages is a MediaWiki extension that prevents users who are not members of the staff group but who have the editinterface user right from editing English interface messages (pages in the MediaWiki namespace that either have the /en suffix or no slash character at all).

This extension was written by Jack Phoenix for ShoutWiki to fix ShoutWiki bug #54.

Installation[edit]

  • Download and place the file(s) in a directory called LockDownEnglishPages in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'LockDownEnglishPages' );
    
  • YesY Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Explanation of the logic[edit]

The extension checks that:

  1. the page we're trying to edit is in the NS_MEDIAWIKI namespace
  2. that we have the 'editinterface' user right (which sysops by default have)
  3. that we are not a member of the staff group and
  4. that $action is 'edit'

Then it proceeds to check the current title. If the current title has either /en or alternatively no / at all in its title, editing will be prevented.

Rationale[edit]

ShoutWiki's custom extensions and other things are translatable via the Interface Messages Wiki (where the MessageCommons extension is installed). We are rather liberal with the administrator rights over there, but since administrators (by default) have the editinterface user right, they may accidentally mess up the English pages, in case if they forget to add their language's language code to the page URL (i.e. they want to edit MediaWiki:Foo/fr but they accidentally end up editing MediaWiki:Foo, the English message). This extension prevents translators from accidentally messing up the English interface messages by disallowing them to edit those messages.