From 493ba1821e3cb0fb35bff7b382cf649e961dc4a7 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 25 Apr 2006 01:44:04 +0000 Subject: [PATCH] * Indicate when a protected page is an interface message ("protectedinterface") * (bug 4259) Indicate when a protected page being edited is an interface message ("editinginterface") --- RELEASE-NOTES | 3 +++ includes/EditPage.php | 8 +++++++- includes/OutputPage.php | 9 ++++++++- languages/Messages.php | 2 ++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 15640856e5..045ebd233f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/EditPage.php b/includes/EditPage.php index 07603aae9e..d8c4b6f5a9 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4d7cf9cdc0..4aecedbfb0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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 ) { diff --git a/languages/Messages.php b/languages/Messages.php index 3979f6d1a4..17b0fc1f28 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -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 -- 2.20.1