mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-28 00:40:38 +00:00
Update loginAttempt.php for new login handling code
Bug: T187519 Change-Id: I98982c339c1960c755a95829b4e4bd827d6e37ba
This commit is contained in:
parent
a087d2bb9c
commit
c7a27caee9
|
@ -2,10 +2,12 @@
|
|||
|
||||
namespace LoginNotify\Maintenance;
|
||||
|
||||
use Hooks;
|
||||
use Maintenance;
|
||||
use FauxRequest;
|
||||
use MediaWiki\Auth\AuthenticationResponse;
|
||||
use RawMessage;
|
||||
use User;
|
||||
use LoginNotify\Hooks as LNHooks;
|
||||
|
||||
$IP = getenv( 'MW_INSTALL_PATH' );
|
||||
if ( $IP === false ) {
|
||||
|
@ -64,10 +66,12 @@ class LoginAttempt extends Maintenance {
|
|||
|
||||
for ( $i = 0; $i < $reps; $i++ ) {
|
||||
if ( $success ) {
|
||||
LNHooks::doSuccessfulLogin( $user );
|
||||
$res = AuthenticationResponse::newPass( $username );
|
||||
Hooks::run( 'AuthManagerLoginAuthenticateAudit', [ $res, $user, $username ] );
|
||||
$this->output( "A successful login attempt was registered!\n" );
|
||||
} else {
|
||||
LNHooks::doFailedLogin( $user );
|
||||
$res = AuthenticationResponse::newFail( new RawMessage( 'Well, it failed' ) );
|
||||
Hooks::run( 'AuthManagerLoginAuthenticateAudit', [ $res, null, $username ] );
|
||||
$this->output( "A failed login attempt was registered!\n" );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue