Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398511 )

Change subject: Use extension registry to check for CheckUser to be installed
......................................................................

Use extension registry to check for CheckUser to be installed

Class was renamed in I39c60b2d059d1cb2c1c0d3a4206232d961536697

Change-Id: I8ca79302b9bbd8999e49a134240420d5cd6117c1
---
M includes/LoginNotify.php
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LoginNotify 
refs/changes/11/398511/1

diff --git a/includes/LoginNotify.php b/includes/LoginNotify.php
index 956c629..a784fa3 100644
--- a/includes/LoginNotify.php
+++ b/includes/LoginNotify.php
@@ -238,7 +238,7 @@
                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.
@@ -402,6 +402,14 @@
        }
 
        /**
+        * 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.
         *
         * @note If user already has a cookie, this will refresh it.

-- 
To view, visit https://gerrit.wikimedia.org/r/398511
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ca79302b9bbd8999e49a134240420d5cd6117c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LoginNotify
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to