r85102 MediaWiki - Code Review archive

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

Diff [purge]

Index: branches/REL1_16/phase3/includes/specials/SpecialImport.php
@@ -63,9 +63,16 @@
6464 # FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
6565 # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
6666 $errors = wfMergeErrorArrays(
67 - $this->getTitle()->getUserPermissionsErrors( 'import', $wgUser, true, array( 'ns-specialprotected' ) ),
68 - $this->getTitle()->getUserPermissionsErrors( 'importupload', $wgUser, true, array( 'ns-specialprotected' ) )
 67+ $this->getTitle()->getUserPermissionsErrors(
 68+ 'import', $wgUser, true,
 69+ array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
 70+ ),
 71+ $this->getTitle()->getUserPermissionsErrors(
 72+ 'importupload', $wgUser, true,
 73+ array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
 74+ )
6975 );
 76+
7077 if( $errors ){
7178 $wgOut->showPermissionsErrorPage( $errors );
7279 return;
@@ -99,6 +106,9 @@
100107 return $wgOut->permissionRequired( 'importupload' );
101108 }
102109 } elseif ( $sourceName == "interwiki" ) {
 110+ if( !$wgUser->isAllowed( 'import' ) ){
 111+ return $wgOut->permissionRequired( 'import' );
 112+ }
103113 $this->interwiki = $wgRequest->getVal( 'interwiki' );
104114 if ( !in_array( $this->interwiki, $wgImportSources ) ) {
105115 $source = new WikiErrorMsg( "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