dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add help link to Special:NewSection"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialImport.php
diff --git
a/includes/specials/SpecialImport.php
b/includes/specials/SpecialImport.php
index
a985bcc
..
f21c206
100644
(file)
--- a/
includes/specials/SpecialImport.php
+++ b/
includes/specials/SpecialImport.php
@@
-24,6
+24,9
@@
* @ingroup SpecialPage
*/
* @ingroup SpecialPage
*/
+use MediaWiki\MediaWikiServices;
+use MediaWiki\Permissions\PermissionManager;
+
/**
* MediaWiki page data importer
*
/**
* MediaWiki page data importer
*
@@
-74,7
+77,10
@@
class SpecialImport extends SpecialPage {
Hooks::run( 'ImportSources', [ &$this->importSources ] );
$user = $this->getUser();
Hooks::run( 'ImportSources', [ &$this->importSources ] );
$user = $this->getUser();
- if ( !$user->isAllowedAny( 'import', 'importupload' ) ) {
+ if ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasAnyRight( $user, 'import', 'importupload' )
+ ) {
throw new PermissionsError( 'import' );
}
throw new PermissionsError( 'import' );
}
@@
-83,11
+89,11
@@
class SpecialImport extends SpecialPage {
# getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
$errors = wfMergeErrorArrays(
$this->getPageTitle()->getUserPermissionsErrors(
# getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
$errors = wfMergeErrorArrays(
$this->getPageTitle()->getUserPermissionsErrors(
- 'import', $user,
true
,
+ 'import', $user,
PermissionManager::RIGOR_FULL
,
[ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
),
$this->getPageTitle()->getUserPermissionsErrors(
[ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
),
$this->getPageTitle()->getUserPermissionsErrors(
- 'importupload', $user,
true
,
+ 'importupload', $user,
PermissionManager::RIGOR_FULL
,
[ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
)
);
[ 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ]
)
);
@@
-320,7
+326,7
@@
class SpecialImport extends SpecialPage {
$action = $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] );
$user = $this->getUser();
$out = $this->getOutput();
$action = $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] );
$user = $this->getUser();
$out = $this->getOutput();
- $this->addHelpLink( '//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Import', true );
+ $this->addHelpLink( '
https:
//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Import', true );
if ( $user->isAllowed( 'importupload' ) ) {
$mappingSelection = $this->getMappingFormPart( 'upload' );
if ( $user->isAllowed( 'importupload' ) ) {
$mappingSelection = $this->getMappingFormPart( 'upload' );
@@
-391,10
+397,8
@@
class SpecialImport extends SpecialPage {
Xml::closeElement( 'form' ) .
Xml::closeElement( 'fieldset' )
);
Xml::closeElement( 'form' ) .
Xml::closeElement( 'fieldset' )
);
- } else {
- if ( empty( $this->importSources ) ) {
- $out->addWikiMsg( 'importnosources' );
- }
+ } elseif ( empty( $this->importSources ) ) {
+ $out->addWikiMsg( 'importnosources' );
}
if ( $user->isAllowed( 'import' ) && !empty( $this->importSources ) ) {
}
if ( $user->isAllowed( 'import' ) && !empty( $this->importSources ) ) {