From 6479ef67fc6a453672df4c2afd2be82a9d718f7b Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 17 May 2009 17:32:25 +0000 Subject: [PATCH] (bug 18466) Add note or warning when overruling a move (semi-)protection (patch by Nakon with tweaks by Siebrand) --- RELEASE-NOTES | 1 + includes/specials/SpecialMovepage.php | 16 ++++++++++++++++ languages/messages/MessagesEn.php | 2 ++ maintenance/language/messages.inc | 2 ++ 4 files changed, 21 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d11763df55..a3c3397b50 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -51,6 +51,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 9219) Auth plugins can control editing RealName/Email/Nick preferences * New hook: MessageNotInMwNs to handle localised messages that aren't in the Mediawiki Namespace, before checking the message files +* (bug 18466) Add note or warning when overruling a move (semi-)protection === Bug fixes in 1.16 === diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 7974e2bd46..0c05da0847 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -166,6 +166,22 @@ class MovePageForm { } } + if ( $this->oldTitle->isProtected( 'move' ) ) { + # Is the title semi-protected? + if ( $this->oldTitle->isSemiProtected( 'move' ) ) { + $noticeMsg = 'semiprotectedpagemovewarning'; + $classes[] = 'mw-textarea-sprotected'; + } else { + # Then it must be protected based on static groups (regular) + $noticeMsg = 'protectedpagemovewarning'; + $classes[] = 'mw-textarea-protected'; + } + $wgOut->addHTML( "
\n" ); + $wgOut->addWikiMsg( $noticeMsg ); + LogEventsList::showLogExtract( $wgOut, 'protect', $this->oldTitle->getPrefixedText(), '', 1 ); + $wgOut->addHTML( "
\n" ); + } + $wgOut->addHTML( Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) . Xml::openElement( 'fieldset' ) . diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 6ea5c2de37..5c4189e138 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2820,6 +2820,8 @@ cannot move a page over itself.', 'imageinvalidfilename' => 'The target file name is invalid', 'fix-double-redirects' => 'Update any redirects that point to the original title', 'move-leave-redirect' => 'Leave a redirect behind', +'protectedpagemovewarning' => "'''WARNING: This page has been locked so that only users with administrator privileges can move it.", +'semiprotectedpagemovewarning' => "'''Note:''' This page has been locked so that only registered users can move it.", # Export 'export' => 'Export pages', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index a594c23e53..74f17e21d3 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1967,6 +1967,8 @@ $wgMessageStructure = array( 'imageinvalidfilename', 'fix-double-redirects', 'move-leave-redirect', + 'protectedpagemovewarning', + 'semiprotectedpagemovewarning', ), 'export' => array( 'export', -- 2.20.1