r74510 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74509‎ | r74510 | r74511 >
Date:13:01, 8 October 2010
Author:soxred93
Status:ok (Comments)
Tags:
Comment:
=(bug 23819) Add option to suppress redirects when renaming user
Modified paths:
  • /trunk/extensions/Renameuser/Renameuser.i18n.php (modified) (history)
  • /trunk/extensions/Renameuser/Renameuser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/Renameuser_body.php
@@ -52,10 +52,14 @@
5353 // If nothing given for these flags, assume they are checked
5454 // unless this is a POST submission.
5555 $move_checked = true;
 56+ $suppress_checked = false;
5657 if ( $wgRequest->wasPosted() ) {
5758 if ( !$wgRequest->getCheck( 'movepages' ) ) {
5859 $move_checked = false;
5960 }
 61+ if ( $wgRequest->getCheck( 'suppressredirect' ) ) {
 62+ $suppress_checked = true;
 63+ }
6064 }
6165 $warnings = array();
6266 if ( $oun && $nun && !$wgRequest->getCheck( 'confirmaction' ) ) {
@@ -104,6 +108,19 @@
105109 "</td>
106110 </tr>"
107111 );
 112+
 113+ if ( $wgUser->isAllowed( 'suppressredirect' ) ) {
 114+ $wgOut->addHTML( "
 115+ <tr>
 116+ <td>&#160;
 117+ </td>
 118+ <td class='mw-input'>" .
 119+ Xml::checkLabel( wfMsg( 'renameusersuppress' ), 'suppressredirect', 'suppressredirect',
 120+ $suppress_checked, array( 'tabindex' => '5' ) ) .
 121+ "</td>
 122+ </tr>"
 123+ );
 124+ }
108125 }
109126 if ( $warnings ) {
110127 $warningsHtml = array();
@@ -288,6 +305,13 @@
289306 ),
290307 __METHOD__
291308 );
 309+
 310+ $suppressRedirect = false;
 311+ var_dump($wgRequest->getCheck( 'suppressredirect' ));
 312+ if ( $wgRequest->getCheck( 'suppressredirect' ) && $wgUser->isAllowed( 'suppressredirect' ) ) {
 313+ $suppressRedirect = true;
 314+ }
 315+ var_dump($suppressRedirect);
292316
293317 $output = '';
294318 $skin =& $wgUser->getSkin();
@@ -301,7 +325,7 @@
302326 $output .= '<li class="mw-renameuser-pe">' . wfMsgHtml( 'renameuser-page-exists', $link ) . '</li>';
303327 } else {
304328 $success = $oldPage->moveTo( $newPage, false, wfMsgForContent( 'renameuser-move-log',
305 - $oldusername->getText(), $newusername->getText() ) );
 329+ $oldusername->getText(), $newusername->getText() ), !$suppressRedirect );
306330 if ( $success === true ) {
307331 $oldLink = $skin->makeKnownLinkObj( $oldPage, '', 'redirect=no' );
308332 $newLink = $skin->makeKnownLinkObj( $newPage );
Index: trunk/extensions/Renameuser/Renameuser.i18n.php
@@ -18,6 +18,7 @@
1919 'renameusernew' => 'New username:',
2020 'renameuserreason' => 'Reason for rename:',
2121 'renameusermove' => 'Move user and talk pages (and their subpages) to new name',
 22+ 'renameusersuppress' => 'Don\'t create redirects to the new name',
2223 'renameuserreserve' => 'Block the old username from future use',
2324 'renameuserwarnings' => 'Warnings:',
2425 'renameuserconfirm' => 'Yes, rename the user',

Follow-up revisions

RevisionCommit summaryAuthorDate
r74511fix r74510: remove debugging codesoxred9313:02, 8 October 2010
r74512Follow-up r74510: Consistency wordingraymond13:11, 8 October 2010
r82804* (bug 23819) Special:RenameUser should allow suppression of automatically-cr...reedy17:29, 25 February 2011
r83034bug 23819/followup r82804reedy19:03, 1 March 2011

Comments

#Comment by Xeno (talk | contribs)   02:12, 10 January 2011

Is there an estimate as to when this functionality will go live?

#Comment by Reedy (talk | contribs)   02:14, 10 January 2011

All being well, it should go in with the 1.17 code update, hopefully before January is out! :)

#Comment by Xeno (talk | contribs)   02:15, 10 January 2011

Excellent. Thanks all, for the diligent efforts.

#Comment by Xeno (talk | contribs)   16:29, 16 February 2011

Please see https://bugzilla.wikimedia.org/show_bug.cgi?id=23819#c6 , we would like the special page to obey parameter inputs such as "suppressredirect=1".

Status & tagging log