r50701 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50700‎ | r50701 | r50702 >
Date:17:32, 17 May 2009
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
(bug 18466) Add note or warning when overruling a move (semi-)protection (patch by Nakon with tweaks by Siebrand)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMovepage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1967,6 +1967,8 @@
19681968 'imageinvalidfilename',
19691969 'fix-double-redirects',
19701970 'move-leave-redirect',
 1971+ 'protectedpagemovewarning',
 1972+ 'semiprotectedpagemovewarning',
19711973 ),
19721974 'export' => array(
19731975 'export',
Index: trunk/phase3/includes/specials/SpecialMovepage.php
@@ -166,6 +166,22 @@
167167 }
168168 }
169169
 170+ if ( $this->oldTitle->isProtected( 'move' ) ) {
 171+ # Is the title semi-protected?
 172+ if ( $this->oldTitle->isSemiProtected( 'move' ) ) {
 173+ $noticeMsg = 'semiprotectedpagemovewarning';
 174+ $classes[] = 'mw-textarea-sprotected';
 175+ } else {
 176+ # Then it must be protected based on static groups (regular)
 177+ $noticeMsg = 'protectedpagemovewarning';
 178+ $classes[] = 'mw-textarea-protected';
 179+ }
 180+ $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
 181+ $wgOut->addWikiMsg( $noticeMsg );
 182+ LogEventsList::showLogExtract( $wgOut, 'protect', $this->oldTitle->getPrefixedText(), '', 1 );
 183+ $wgOut->addHTML( "</div>\n" );
 184+ }
 185+
170186 $wgOut->addHTML(
171187 Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) .
172188 Xml::openElement( 'fieldset' ) .
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2820,6 +2820,8 @@
28212821 'imageinvalidfilename' => 'The target file name is invalid',
28222822 'fix-double-redirects' => 'Update any redirects that point to the original title',
28232823 'move-leave-redirect' => 'Leave a redirect behind',
 2824+'protectedpagemovewarning' => "'''WARNING: This page has been locked so that only users with administrator privileges can move it.",
 2825+'semiprotectedpagemovewarning' => "'''Note:''' This page has been locked so that only registered users can move it.",
28242826
28252827 # Export
28262828 'export' => 'Export pages',
Index: trunk/phase3/RELEASE-NOTES
@@ -51,6 +51,7 @@
5252 * (bug 9219) Auth plugins can control editing RealName/Email/Nick preferences
5353 * New hook: MessageNotInMwNs to handle localised messages that aren't in the
5454 Mediawiki Namespace, before checking the message files
 55+* (bug 18466) Add note or warning when overruling a move (semi-)protection
5556
5657 === Bug fixes in 1.16 ===
5758

Follow-up revisions

RevisionCommit summaryAuthorDate
r50703Follow-up on r50701. Close bold on WARNING.siebrand18:12, 17 May 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   20:34, 18 May 2009

Spiffy. :D

Status & tagging log