r44501 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44500‎ | r44501 | r44502 >
Date:14:06, 12 December 2008
Author:raymond
Status:ok
Tags:
Comment:
Quick hack to disable import for non privileged users. Prolly a regression from r43963
Modified paths:
  • /trunk/phase3/includes/specials/SpecialImport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialImport.php
@@ -128,6 +128,11 @@
129129
130130 private function showForm() {
131131 global $wgUser, $wgOut, $wgRequest, $wgTitle, $wgImportSources;
 132+ # FIXME: Quick hack to disable import for non privileged users /Raymond
 133+ # Regression from 43963
 134+ if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) )
 135+ return $wgOut->permissionRequired( 'import' );
 136+
132137 $action = $wgTitle->getLocalUrl( 'action=submit' );
133138
134139 if( $wgUser->isAllowed( 'importupload' ) ) {
@@ -173,8 +178,8 @@
174179 $wgOut->addWikiMsg( 'importnosources' );
175180 }
176181 }
177 -
178 - if( !empty( $wgImportSources ) ) {
 182+
 183+ if( $wgUser->isAllowed( 'import' ) && !empty( $wgImportSources ) ) {
179184 $wgOut->addHTML(
180185 Xml::openElement( 'fieldset' ) .
181186 Xml::element( 'legend', null, wfMsg( 'importinterwiki' ) ) .

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r43963Refactor Special:Import to extend SpecialPage instead of wfSpecialImport() st...demon02:10, 26 November 2008

Status & tagging log