Remove compatibility with pre-1.27 MediaWiki

Change-Id: I3f7fd7b11d5f710ae4e940bdddd7001aa6948cf3
This commit is contained in:
Max Semenik 2017-10-06 18:40:02 -07:00
parent ae10515553
commit ee5ae41740
2 changed files with 3 additions and 42 deletions

View file

@ -9,6 +9,7 @@
"license-name": "MIT", "license-name": "MIT",
"type": "other", "type": "other",
"requires": { "requires": {
"MediaWiki": ">= 1.27.0",
"extensions": { "extensions": {
"Echo": "*" "Echo": "*"
} }
@ -37,15 +38,9 @@
"EchoGetBundleRules": [ "EchoGetBundleRules": [
"LoginNotify\\Hooks::onEchoGetBundleRules" "LoginNotify\\Hooks::onEchoGetBundleRules"
], ],
"LoginAuthenticateAudit": [
"LoginNotify\\Hooks::onLoginAuthenticateAudit"
],
"AuthManagerLoginAuthenticateAudit": [ "AuthManagerLoginAuthenticateAudit": [
"LoginNotify\\Hooks::onAuthManagerLoginAuthenticateAudit" "LoginNotify\\Hooks::onAuthManagerLoginAuthenticateAudit"
], ],
"AddNewAccount": [
"LoginNotify\\Hooks::onAddNewAccount"
],
"LocalUserCreated": [ "LocalUserCreated": [
"LoginNotify\\Hooks::onLocalUserCreated" "LoginNotify\\Hooks::onLocalUserCreated"
] ]

View file

@ -10,7 +10,6 @@ namespace LoginNotify;
use EchoAttributeManager; use EchoAttributeManager;
use EchoEvent; use EchoEvent;
use LoginForm;
use MediaWiki\Auth\AuthenticationResponse; use MediaWiki\Auth\AuthenticationResponse;
use User; use User;
@ -97,24 +96,7 @@ class Hooks {
} }
/** /**
* Old hook for pre 1.27 or wikis with auth manager disabled. * Hook for login auditing
*
* @todo Doesn't catch CAPTCHA or throttle failures
*
* @param User $user User in question.
* @param string $pass The password (parameter not used).
* @param int $retval A LoginForm constant (e.g. LoginForm::SUCCESS).
*/
public static function onLoginAuthenticateAudit( User $user, $pass, $retval ) {
if ( $retval === LoginForm::WRONG_PASS ) {
self::doFailedLogin( $user );
} elseif ( $retval === LoginForm::SUCCESS ) {
self::doSuccessfulLogin( $user );
}
}
/**
* Hook for login auditing post 1.27
* *
* @param AuthenticationResponse $ret Is login successful? * @param AuthenticationResponse $ret Is login successful?
* @param User|null $user User object on successful auth * @param User|null $user User object on successful auth
@ -165,23 +147,7 @@ class Hooks {
} }
/** /**
* Deprecated since v1.27 * Hook handler for new account creation.
*
* Set a cookie saying this is a known computer when creating an account.
*
* @todo This still sets cookies if user creates an account while logged in as someone else.
* @param User $user The user that has been created.
* @param bool $byMail Account created by email
*/
public static function onAddNewAccount( User $user, $byMail ) {
if ( !$byMail ) {
$loginNotify = new LoginNotify();
$loginNotify->setCurrentAddressAsKnown( $user );
}
}
/**
* Hook for new account creation since v1.27
* *
* Called immediately after a local user has been created and saved to the database * Called immediately after a local user has been created and saved to the database
* *