From: Raimond Spekking Date: Fri, 12 Dec 2008 14:06:30 +0000 (+0000) Subject: Quick hack to disable import for non privileged users. Prolly a regression from r43963 X-Git-Tag: 1.31.0-rc.0~44014 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=7e3ef7cf5e63324daa5c43ac7c1abe010e36e872;p=lhc%2Fweb%2Fwiklou.git Quick hack to disable import for non privileged users. Prolly a regression from r43963 --- diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 9c158fe603..5e1a653329 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -128,6 +128,11 @@ class SpecialImport extends SpecialPage { private function showForm() { global $wgUser, $wgOut, $wgRequest, $wgTitle, $wgImportSources; + # FIXME: Quick hack to disable import for non privileged users /Raymond + # Regression from 43963 + if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) ) + return $wgOut->permissionRequired( 'import' ); + $action = $wgTitle->getLocalUrl( 'action=submit' ); if( $wgUser->isAllowed( 'importupload' ) ) { @@ -173,8 +178,8 @@ class SpecialImport extends SpecialPage { $wgOut->addWikiMsg( 'importnosources' ); } } - - if( !empty( $wgImportSources ) ) { + + if( $wgUser->isAllowed( 'import' ) && !empty( $wgImportSources ) ) { $wgOut->addHTML( Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'importinterwiki' ) ) .