From: Brion Vibber Date: Fri, 26 Aug 2005 21:40:21 +0000 (+0000) Subject: * (bug 3280) Respect 'move' group permission on page moves X-Git-Tag: 1.6.0~1786 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=b60e432785e238297c078f0669a52c373cc4940d;p=lhc%2Fweb%2Fwiklou.git * (bug 3280) Respect 'move' group permission on page moves Note: if you turn *on* moves for anonymous users this will break the log a bit, since the entries won't join to the user table by id. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 42ba06ca46..87d6c2d339 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -56,6 +56,8 @@ Misc work going on..... fully support the editing toolbar, but was found to be too confusing. * (bug 2554) Tell users they are uploading too large file * (bug 3271) Updated LanguageNn.php for HEAD +* (bug 3280) Respect 'move' group permission on page moves + === Caveats === diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index b4dcb45f63..732d38f23a 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -623,14 +623,12 @@ class SkinTemplate extends Skin { 'href' => $this->mTitle->getLocalUrl( 'action=delete' ) ); } - if ( $wgUser->isLoggedIn() ) { - if ( $this->mTitle->userCanMove()) { - $content_actions['move'] = array( - 'class' => ($this->mTitle->getDbKey() == 'Movepage' and $this->mTitle->getNamespace == NS_SPECIAL) ? 'selected' : false, - 'text' => wfMsg('move'), - 'href' => $this->makeSpecialUrl("Movepage/$this->thispage" ) - ); - } + if ( $this->mTitle->userCanMove()) { + $content_actions['move'] = array( + 'class' => ($this->mTitle->getDbKey() == 'Movepage' and $this->mTitle->getNamespace == NS_SPECIAL) ? 'selected' : false, + 'text' => wfMsg('move'), + 'href' => $this->makeSpecialUrl("Movepage/$this->thispage" ) + ); } } else { //article doesn't exist or is deleted diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 58f445cf1d..4d4abaf16e 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -17,7 +17,7 @@ function wfSpecialMovepage( $par = null ) { global $wgUser, $wgOut, $wgRequest, $action, $wgOnlySysopMayMove; # check rights. We don't want newbies to move pages to prevents possible attack - if ( $wgUser->isAnon() or $wgUser->isBlocked() or ($wgOnlySysopMayMove and $wgUser->isNewbie())) { + if ( !$wgUser->isAllowed( 'move' ) or $wgUser->isBlocked() or ($wgOnlySysopMayMove and $wgUser->isNewbie())) { $wgOut->errorpage( "movenologin", "movenologintext" ); return; } diff --git a/includes/Title.php b/includes/Title.php index b4c681c6b9..090dd907c8 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -951,7 +951,8 @@ class Title { } } - if( $action == 'move' && !$this->isMovable() ) { + if( $action == 'move' && + !( $this->isMovable() && $wgUser->isAllowed( 'move' ) ) ) { wfProfileOut( $fname ); return false; }