| Index: trunk/phase3/includes/Title.php |
| — | — | @@ -2193,7 +2193,8 @@ |
| 2194 | 2194 | * @param bool $auth indicates whether $wgUser's permissions |
| 2195 | 2195 | * should be checked |
| 2196 | 2196 | * @param string $reason The reason for the move |
| 2197 | | - * @param bool $createRedirect Whether to create a redirect from the old title to the new title |
| | 2197 | + * @param bool $createRedirect Whether to create a redirect from the old title to the new title. |
| | 2198 | + * Ignored if the user doesn't have the suppressredirect right. |
| 2198 | 2199 | * @return mixed true on success, message name on failure |
| 2199 | 2200 | */ |
| 2200 | 2201 | public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true ) { |
| — | — | @@ -2268,10 +2269,11 @@ |
| 2269 | 2270 | * @param Title &$nt the page to move to, which should currently |
| 2270 | 2271 | * be a redirect |
| 2271 | 2272 | * @param string $reason The reason for the move |
| 2272 | | - * @param bool $createRedirect Whether to leave a redirect at the old title |
| | 2273 | + * @param bool $createRedirect Whether to leave a redirect at the old title. |
| | 2274 | + * Ignored if the user doesn't have the suppressredirect right |
| 2273 | 2275 | */ |
| 2274 | 2276 | private function moveOverExistingRedirect( &$nt, $reason = '', $createRedirect = true ) { |
| 2275 | | - global $wgUseSquid; |
| | 2277 | + global $wgUseSquid, $wgUser; |
| 2276 | 2278 | $fname = 'Title::moveOverExistingRedirect'; |
| 2277 | 2279 | $comment = wfMsgForContent( '1movedto2_redir', $this->getPrefixedText(), $nt->getPrefixedText() ); |
| 2278 | 2280 | |
| — | — | @@ -2309,7 +2311,7 @@ |
| 2310 | 2312 | $linkCache->clearLink( $nt->getPrefixedDBkey() ); |
| 2311 | 2313 | |
| 2312 | 2314 | # Recreate the redirect, this time in the other direction. |
| 2313 | | - if($createRedirect) |
| | 2315 | + if($createRedirect || !$wgUser->isAllowed('suppressredirect')) |
| 2314 | 2316 | { |
| 2315 | 2317 | $mwRedir = MagicWord::get( 'redirect' ); |
| 2316 | 2318 | $redirectText = $mwRedir->getSynonym( 0 ) . ' [[' . $nt->getPrefixedText() . "]]\n"; |
| — | — | @@ -2351,9 +2353,10 @@ |
| 2352 | 2354 | * @param Title &$nt the new Title |
| 2353 | 2355 | * @param string $reason The reason for the move |
| 2354 | 2356 | * @param bool $createRedirect Whether to create a redirect from the old title to the new title |
| | 2357 | + * Ignored if the user doesn't have the suppressredirect right |
| 2355 | 2358 | */ |
| 2356 | 2359 | private function moveToNewTitle( &$nt, $reason = '', $createRedirect = true ) { |
| 2357 | | - global $wgUseSquid; |
| | 2360 | + global $wgUseSquid, $wgUser; |
| 2358 | 2361 | $fname = 'MovePageForm::moveToNewTitle'; |
| 2359 | 2362 | $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ); |
| 2360 | 2363 | if ( $reason ) { |
| — | — | @@ -2384,7 +2387,7 @@ |
| 2385 | 2388 | |
| 2386 | 2389 | $linkCache->clearLink( $nt->getPrefixedDBkey() ); |
| 2387 | 2390 | |
| 2388 | | - if($createRedirect) |
| | 2391 | + if($createRedirect || !$wgUser->isAllowed('suppressredirect')) |
| 2389 | 2392 | { |
| 2390 | 2393 | # Insert redirect |
| 2391 | 2394 | $mwRedir = MagicWord::get( 'redirect' ); |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -1097,6 +1097,7 @@ |
| 1098 | 1098 | $wgGroupPermissions['sysop']['ipblock-exempt'] = true; |
| 1099 | 1099 | $wgGroupPermissions['sysop']['blockemail'] = true; |
| 1100 | 1100 | $wgGroupPermissions['sysop']['markbotedits'] = true; |
| | 1101 | +$wgGroupPermissions['sysop']['suppressredirect'] = true; |
| 1101 | 1102 | |
| 1102 | 1103 | // Permission to change users' group assignments |
| 1103 | 1104 | $wgGroupPermissions['bureaucrat']['userrights'] = true; |