Index: trunk/extensions/Renameuser/Renameuser_body.php |
— | — | @@ -52,10 +52,14 @@ |
53 | 53 | // If nothing given for these flags, assume they are checked |
54 | 54 | // unless this is a POST submission. |
55 | 55 | $move_checked = true; |
| 56 | + $suppress_checked = false; |
56 | 57 | if ( $wgRequest->wasPosted() ) { |
57 | 58 | if ( !$wgRequest->getCheck( 'movepages' ) ) { |
58 | 59 | $move_checked = false; |
59 | 60 | } |
| 61 | + if ( $wgRequest->getCheck( 'suppressredirect' ) ) { |
| 62 | + $suppress_checked = true; |
| 63 | + } |
60 | 64 | } |
61 | 65 | $warnings = array(); |
62 | 66 | if ( $oun && $nun && !$wgRequest->getCheck( 'confirmaction' ) ) { |
— | — | @@ -104,6 +108,19 @@ |
105 | 109 | "</td> |
106 | 110 | </tr>" |
107 | 111 | ); |
| 112 | + |
| 113 | + if ( $wgUser->isAllowed( 'suppressredirect' ) ) { |
| 114 | + $wgOut->addHTML( " |
| 115 | + <tr> |
| 116 | + <td>  |
| 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 | + } |
108 | 125 | } |
109 | 126 | if ( $warnings ) { |
110 | 127 | $warningsHtml = array(); |
— | — | @@ -288,6 +305,13 @@ |
289 | 306 | ), |
290 | 307 | __METHOD__ |
291 | 308 | ); |
| 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); |
292 | 316 | |
293 | 317 | $output = ''; |
294 | 318 | $skin =& $wgUser->getSkin(); |
— | — | @@ -301,7 +325,7 @@ |
302 | 326 | $output .= '<li class="mw-renameuser-pe">' . wfMsgHtml( 'renameuser-page-exists', $link ) . '</li>'; |
303 | 327 | } else { |
304 | 328 | $success = $oldPage->moveTo( $newPage, false, wfMsgForContent( 'renameuser-move-log', |
305 | | - $oldusername->getText(), $newusername->getText() ) ); |
| 329 | + $oldusername->getText(), $newusername->getText() ), !$suppressRedirect ); |
306 | 330 | if ( $success === true ) { |
307 | 331 | $oldLink = $skin->makeKnownLinkObj( $oldPage, '', 'redirect=no' ); |
308 | 332 | $newLink = $skin->makeKnownLinkObj( $newPage ); |
Index: trunk/extensions/Renameuser/Renameuser.i18n.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | 'renameusernew' => 'New username:', |
20 | 20 | 'renameuserreason' => 'Reason for rename:', |
21 | 21 | 'renameusermove' => 'Move user and talk pages (and their subpages) to new name', |
| 22 | + 'renameusersuppress' => 'Don\'t create redirects to the new name', |
22 | 23 | 'renameuserreserve' => 'Block the old username from future use', |
23 | 24 | 'renameuserwarnings' => 'Warnings:', |
24 | 25 | 'renameuserconfirm' => 'Yes, rename the user', |