mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-15 03:04:08 +00:00
Merge "Use extension registry to check for CheckUser to be installed"
This commit is contained in:
commit
507dd282a9
|
@ -12,6 +12,7 @@ use BagOStuff;
|
|||
use CentralAuthUser;
|
||||
use Config;
|
||||
use EchoEvent;
|
||||
use ExtensionRegistry;
|
||||
use IBufferingStatsdDataFactory;
|
||||
use JobQueueGroup;
|
||||
use JobSpecification;
|
||||
|
@ -238,7 +239,7 @@ class LoginNotify implements LoggerAwareInterface {
|
|||
Assert::parameter( $user->isLoggedIn(), '$user', 'User must be logged in' );
|
||||
|
||||
if ( !$this->config->get( 'LoginNotifyCheckKnownIPs' )
|
||||
|| !class_exists( 'CheckUser' )
|
||||
|| !$this->isCheckUserInstalled()
|
||||
) {
|
||||
// Checkuser checks disabled.
|
||||
// Note: It's important this be USER_NOT_KNOWN and not USER_NO_INFO.
|
||||
|
@ -401,6 +402,14 @@ class LoginNotify implements LoggerAwareInterface {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether CheckUser extension is installed
|
||||
* @return bool
|
||||
*/
|
||||
private function isCheckUserInstalled() {
|
||||
return ExtensionRegistry::getInstance()->isLoaded( 'CheckUser' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Give the user a cookie saying that they've previously logged in from this computer.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue