mediawiki-extensions-Nuke/includes/ServiceWiring.php
jsn 98aa8d9942
Enable temp account lookup by IP address
- Adds a soft dependency on CheckUser
- Lists pages created by IP user or temp acccounts associated with IP
  address when the lookup is available

Bug: T342785
Depends-On: I45a18f1fcf1a17bdaeefabebcd2f67a946a2cc2e
Change-Id: Idcdd7d787180e8e99fdcbe856e4fc237d9721824
2024-10-21 10:18:32 +02:00

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' );
}
];