(bug 18466) Add note or warning when overruling a move (semi-)protection (patch by...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 17 May 2009 17:32:25 +0000 (17:32 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 17 May 2009 17:32:25 +0000 (17:32 +0000)
RELEASE-NOTES
includes/specials/SpecialMovepage.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index d11763d..a3c3397 100644 (file)
@@ -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 ===
 
index 7974e2b..0c05da0 100644 (file)
@@ -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( "<div class='mw-warning-with-logexcerpt'>\n" );
+                       $wgOut->addWikiMsg( $noticeMsg );
+                       LogEventsList::showLogExtract( $wgOut, 'protect', $this->oldTitle->getPrefixedText(), '', 1 );
+                       $wgOut->addHTML( "</div>\n" );
+               }
+
                $wgOut->addHTML(
                         Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) .
                         Xml::openElement( 'fieldset' ) .
index 6ea5c2d..5c4189e 100644 (file)
@@ -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',
index a594c23..74f17e2 100644 (file)
@@ -1967,6 +1967,8 @@ $wgMessageStructure = array(
                'imageinvalidfilename',
                'fix-double-redirects',
                'move-leave-redirect',
+               'protectedpagemovewarning',
+               'semiprotectedpagemovewarning',
        ),
        'export' => array(
                'export',