From: Tim Starling Date: Mon, 6 Oct 2008 01:21:16 +0000 (+0000) Subject: Allow humans to suppress redirect too, not just bots. Added human interface, gave... X-Git-Tag: 1.31.0-rc.0~44901 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=477f302e1dd16923a3d2622e9a07bc26be4e1168;p=lhc%2Fweb%2Fwiklou.git Allow humans to suppress redirect too, not just bots. Added human interface, gave sysops the right by default. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index f9d3ced611..45b94d98bf 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3456,4 +3456,4 @@ $wgPasswordAttemptThrottle = array( 'count' => 5, 'seconds' => 300 ); * Cache-busting number for dismissable sitenotice * Don't bump this, instead bump the number on [[MediaWiki:Sitenotice id]] */ -$wgMajorSiteNoticeID = 1; \ No newline at end of file +$wgMajorSiteNoticeID = 1; diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 955dd54367..dffa2e4375 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -56,7 +56,7 @@ function wfSpecialMovepage( $par = null ) { class MovePageForm { var $oldTitle, $newTitle; # Objects var $reason; # Text input - var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects; # Checks + var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect; # Checks private $watch = false; @@ -69,9 +69,11 @@ class MovePageForm { if ( $wgRequest->wasPosted() ) { $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', false ); $this->fixRedirects = $wgRequest->getBool( 'wpFixRedirects', false ); + $this->leaveRedirect = $wgRequest->getBool( 'wpLeaveRedirect', false ); } else { $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', true ); $this->fixRedirects = $wgRequest->getBool( 'wpFixRedirects', true ); + $this->leaveRedirect = $wgRequest->getBool( 'wpLeaveRedirect', true ); } $this->moveSubpages = $wgRequest->getBool( 'wpMovesubpages', false ); $this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ) && $wgRequest->getBool( 'wpConfirm' ); @@ -201,6 +203,18 @@ class MovePageForm { ); } + if ( $wgUser->isAllowed( 'suppressredirect' ) ) { + $wgOut->addHTML( " + + + " . + Xml::checkLabel( wfMsg( 'move-leave-redirect' ), 'wpLeaveRedirect', + 'wpLeaveRedirect', $this->leaveRedirect ) . + " + " + ); + } + if ( $hasRedirects ) { $wgOut->addHTML( " @@ -294,7 +308,13 @@ class MovePageForm { return; } - $error = $ot->moveTo( $nt, true, $this->reason ); + if ( $wgUser->isAllowed( 'suppressredirect' ) ) { + $createRedirect = $this->leaveRedirect; + } else { + $createRedirect = true; + } + + $error = $ot->moveTo( $nt, true, $this->reason, $createRedirect ); if ( $error !== true ) { call_user_func_array( array($this, 'showForm'), $error ); return; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 73293d9f98..b2e83801a0 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2660,6 +2660,7 @@ cannot move pages from and into that namespace.', 'imagetypemismatch' => 'The new file extension does not match its type', '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', # Export 'export' => 'Export pages',