mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-28 08:50:17 +00:00
Use ExtensionRegistry to check, if Echo is installed
Instead of checking, if an internal class exists, it's more accurate to require an extension and Extensionregistry will check, if the requirements are fulfilled. If not, it will throw and exception. Depends-On: I2bde10ed08048bc0164446dd59d0d4575870fa54 Change-Id: I85a84988c75290d7df63dec27b69b250e305c896
This commit is contained in:
parent
57bc309d83
commit
3a1a488b23
|
@ -88,9 +88,6 @@ class LoginNotifyHooks {
|
|||
* @param $retval int LoginForm constant (e.g. LoginForm::SUCCESS)
|
||||
*/
|
||||
public static function onLoginAuthenticateAudit( User $user, $pass, $retval ) {
|
||||
if ( !class_exists( 'EchoEvent' ) ) {
|
||||
throw new FatalError( "LoginNotify extension requires the Echo extension to be installed" );
|
||||
}
|
||||
if ( $retval === LoginForm::WRONG_PASS ) {
|
||||
self::doFailedLogin( $user );
|
||||
} elseif ( $retval === LoginForm::SUCCESS ) {
|
||||
|
@ -108,9 +105,6 @@ class LoginNotifyHooks {
|
|||
public static function onAuthManagerLoginAuthenticateAudit(
|
||||
AuthenticationResponse $ret, $user, $username
|
||||
) {
|
||||
if ( !class_exists( 'EchoEvent' ) ) {
|
||||
throw new FatalError( "LoginNotify extension requires the Echo extension to be installed" );
|
||||
}
|
||||
if ( $user ) {
|
||||
$userObj = $user;
|
||||
} else {
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
"descriptionmsg": "loginnotify-desc",
|
||||
"license-name": "MIT",
|
||||
"type": "other",
|
||||
"requires": {
|
||||
"extensions": {
|
||||
"Echo": "*"
|
||||
}
|
||||
},
|
||||
"DefaultUserOptions": {
|
||||
"echo-subscriptions-web-login-fail": true,
|
||||
"echo-subscriptions-email-login-fail": false,
|
||||
|
|
Loading…
Reference in a new issue