r85101 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85100‎ | r85101 | r85102 >
Date:23:27, 31 March 2011
Author:platonides
Status:ok
Tags:
Comment:
MFT r85099
Modified paths:
  • /branches/REL1_17/phase3/includes/specials/SpecialImport.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/specials/SpecialImport.php
@@ -69,9 +69,16 @@
7070 # FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
7171 # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
7272 $errors = wfMergeErrorArrays(
73 - $this->getTitle()->getUserPermissionsErrors( 'import', $wgUser, true, array( 'ns-specialprotected' ) ),
74 - $this->getTitle()->getUserPermissionsErrors( 'importupload', $wgUser, true, array( 'ns-specialprotected' ) )
 73+ $this->getTitle()->getUserPermissionsErrors(
 74+ 'import', $wgUser, true,
 75+ array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
 76+ ),
 77+ $this->getTitle()->getUserPermissionsErrors(
 78+ 'importupload', $wgUser, true,
 79+ array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
 80+ )
7581 );
 82+
7683 if( $errors ){
7784 $wgOut->showPermissionsErrorPage( $errors );
7885 return;
@@ -105,6 +112,9 @@
106113 return $wgOut->permissionRequired( 'importupload' );
107114 }
108115 } elseif ( $sourceName == "interwiki" ) {
 116+ if( !$wgUser->isAllowed( 'import' ) ){
 117+ return $wgOut->permissionRequired( 'import' );
 118+ }
109119 $this->interwiki = $wgRequest->getVal( 'interwiki' );
110120 if ( !in_array( $this->interwiki, $wgImportSources ) ) {
111121 $source = Status::newFatal( "import-invalid-interwiki" );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85099Fix for r85005: the getUserPermissionsErrors() calls were each returning a ba...happy-melon23:09, 31 March 2011

Status & tagging log