From e372679437978dd2b210c7dcdedd6728992a7b7a Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Fri, 8 Sep 2006 10:42:56 +0000 Subject: [PATCH] Make the permissions check in Special:Movepage reasonable: show a proper 'user blocked' page, and remove the variable wgOnlySysopMayMove (which is not mentioned in other places, doesn't work properly, and is deprecated - always use wgGroupPermissions); should also add a check to know if it's a protected page --- includes/SpecialMovepage.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 0593be571b..9777a80c20 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -9,14 +9,21 @@ * Constructor */ function wfSpecialMovepage( $par = null ) { - global $wgUser, $wgOut, $wgRequest, $action, $wgOnlySysopMayMove; + global $wgUser, $wgOut, $wgRequest, $action; - # check rights. We don't want newbies to move pages to prevents possible attack - if ( !$wgUser->isAllowed( 'move' ) or $wgUser->isBlocked() or ($wgOnlySysopMayMove and $wgUser->isNewbie())) { - $wgOut->showErrorPage( "movenologin", "movenologintext" ); + # Check rights + if ( !$wgUser->isAllowed( 'move' ) ) { + $wgOut->showErrorPage( 'movenologin', 'movenologintext' ); return; } - # We don't move protected pages + + # Don't allow blocked users to move pages + if ( $wgUser->isBlocked() ) { + $wgOut->blockedPage(); + return; + } + + # Check for database lock if ( wfReadOnly() ) { $wgOut->readOnlyPage(); return; -- 2.20.1