mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Nuke
synced 2024-11-27 17:50:21 +00:00
25 lines
592 B
PHP
25 lines
592 B
PHP
|
<?php
|
||
|
|
||
|
use MediaWiki\MediaWikiServices;
|
||
|
|
||
|
/*
|
||
|
* CheckUser provides a service for this, but
|
||
|
* we define our own nullable here to make CheckUser a soft dependency
|
||
|
*/
|
||
|
|
||
|
return [
|
||
|
'NukeIPLookup' => static function (
|
||
|
MediaWikiServices $services
|
||
|
) {
|
||
|
// Allow IP lookups if temp user is known and CheckUser is present
|
||
|
if ( !ExtensionRegistry::getInstance()->isLoaded( 'CheckUser' ) ) {
|
||
|
return null;
|
||
|
}
|
||
|
$tempUserIsKnown = $services->getTempUserConfig()->isKnown();
|
||
|
if ( !$tempUserIsKnown ) {
|
||
|
return null;
|
||
|
}
|
||
|
return $services->get( 'CheckUserTemporaryAccountsByIPLookup' );
|
||
|
}
|
||
|
];
|