* Indicate when a protected page is an interface message ("protectedinterface")
authorRob Church <robchurch@users.mediawiki.org>
Tue, 25 Apr 2006 01:44:04 +0000 (01:44 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 25 Apr 2006 01:44:04 +0000 (01:44 +0000)
* (bug 4259) Indicate when a protected page being edited is an interface message ("editinginterface")

RELEASE-NOTES
includes/EditPage.php
includes/OutputPage.php
languages/Messages.php

index 1564085..045ebd2 100644 (file)
@@ -120,6 +120,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 5684) Introduce Special:Randomredirect
 * (bug 5611) Add a name attribute to the text box containing source text in
   read-only pages
+* Indicate when a protected page is an interface message ("protectedinterface")
+* (bug 4259) Indicate when a protected page being edited is an interface message
+  ("editinginterface")
 
 == Compatibility ==
 
index 07603aa..d8c4b6f 100644 (file)
@@ -799,12 +799,18 @@ class EditPage {
                }
                        
                if( $this->mTitle->isProtected( 'edit' ) ) {
-                       if( $this->mTitle->isSemiProtected() ) {
+                       # Is the protection due to the namespace, e.g. interface text?
+                       if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
+                               # Yes; remind the user
+                               $notice = wfMsg( 'editinginterface' );
+                       } elseif( $this->mTitle->isSemiProtected() ) {
+                               # No; semi protected
                                $notice = wfMsg( 'semiprotectedpagewarning' );
                                if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' ) {
                                        $notice = '';
                                }
                        } else {
+                               # No; regular protection
                                $notice = wfMsg( 'protectedpagewarning' );
                        }
                        $wgOut->addWikiText( $notice );
index 4d7cf9c..4aecedb 100644 (file)
@@ -812,7 +812,14 @@ class OutputPage {
                        $skin = $wgUser->getSkin();
                        $this->setPageTitle( wfMsg( 'viewsource' ) );
                        $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
-                       $this->addWikiText( wfMsg( 'protectedtext' ) );
+                       
+                       # Determine if protection is due to the page being a system message
+                       # and show an appropriate explanation
+                       if( $wgTitle->getNamespace() == NS_MEDIAWIKI && !$wgUser->isAllowed( 'editinterface' ) ) {
+                               $this->addWikiText( wfMsg( 'protectedinterface' ) );
+                       } else {
+                               $this->addWikiText( wfMsg( 'protectedtext' ) );
+                       }
                } else {
                        $this->setPageTitle( wfMsg( 'readonly' ) );
                        if ( $wgReadOnly ) {
index 3979f6d..17b0fc1 100644 (file)
@@ -342,6 +342,8 @@ a number of reasons why this may be so, please see
 [[Project:Protected page]].
 
 You can view and copy the source of this page:',
+'protectedinterface' => 'This page provides interface text for the software, and is locked to prevent abuse.',
+'editinginterface' => "'''Warning:''' You are editing a page which is used to provide interface text for the software. Changes to this page will affect the appearance of the user interface for other users.",
 'sqlhidden' => '(SQL query hidden)',
 
 # Login and logout pages