From 842dd1ae1f33cf0b4e3f4b65b32e14916c6bbce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Tisza?= Date: Wed, 10 Aug 2016 01:36:16 +0000 Subject: [PATCH] Rename 'authmanager' log channel to 'authevents' Change-Id: I86f54474714fee19e18dabe7c523ebe1901e51a5 --- SimpleCaptcha/Captcha.php | 21 ++++++++----------- .../auth/CaptchaPreAuthenticationProvider.php | 8 +++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/SimpleCaptcha/Captcha.php b/SimpleCaptcha/Captcha.php index 28debde57..532092f01 100644 --- a/SimpleCaptcha/Captcha.php +++ b/SimpleCaptcha/Captcha.php @@ -205,7 +205,7 @@ class SimpleCaptcha { wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" ); return true; } - LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha shown on account creation', [ + LoggerFactory::getInstance( 'authevents' )->info( 'Captcha shown on account creation', [ 'event' => 'captcha.display', 'type' => 'accountcreation', ] ); @@ -251,7 +251,7 @@ class SimpleCaptcha { if ( $perIPTriggered || $perUserTriggered ) { global $wgOut; - LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha shown on login', [ + LoggerFactory::getInstance( 'authevents' )->info( 'Captcha shown on login', [ 'event' => 'captcha.display', 'type' => 'login', 'perIp' => $perIPTriggered, @@ -868,9 +868,7 @@ class SimpleCaptcha { if ( $this->needCreateAccountCaptcha() ) { $this->trigger = "new account '" . $u->getName() . "'"; $success = $this->passCaptchaLimitedFromRequest( $wgRequest, $wgUser ); - LoggerFactory::getInstance( - 'authmanager' - )->info( 'Captcha submitted on account creation', [ + LoggerFactory::getInstance( 'authevents' )->info( 'Captcha submitted on account creation', [ 'event' => 'captcha.submit', 'type' => 'accountcreation', 'successful' => $success, @@ -933,7 +931,7 @@ class SimpleCaptcha { $this->trigger = "post-badlogin login '" . $u->getName() . "'"; $success = $this->passCaptchaLimitedFromRequest( $wgRequest, $wgUser ); - LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha submitted on login', [ + LoggerFactory::getInstance( 'authevents' )->info( 'Captcha submitted on login', [ 'event' => 'captcha.submit', 'type' => 'login', 'successful' => $success, @@ -1274,12 +1272,11 @@ class SimpleCaptcha { $this->addCaptchaAPI( $result ); $result['result'] = 'NeedCaptcha'; - LoggerFactory::getInstance( - 'authmanager' - )->info( 'Captcha data added in account creation API', [ - 'event' => 'captcha.display', - 'type' => 'accountcreation', - ] ); + LoggerFactory::getInstance( 'authevents' ) + ->info( 'Captcha data added in account creation API', [ + 'event' => 'captcha.display', + 'type' => 'accountcreation', + ] ); break; } diff --git a/includes/auth/CaptchaPreAuthenticationProvider.php b/includes/auth/CaptchaPreAuthenticationProvider.php index 9095368f2..d87785466 100644 --- a/includes/auth/CaptchaPreAuthenticationProvider.php +++ b/includes/auth/CaptchaPreAuthenticationProvider.php @@ -17,7 +17,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider $needed = $captcha->needCreateAccountCaptcha( $user ?: new User() ); if ( $needed ) { $captcha->setAction( 'accountcreate' ); - LoggerFactory::getInstance( 'authmanager' ) + LoggerFactory::getInstance( 'authevents' ) ->info( 'Captcha shown on account creation', [ 'event' => 'captcha.display', 'type' => 'accountcreation', @@ -46,7 +46,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider ) { $needed = true; $captcha->setAction( 'badlogin' ); - LoggerFactory::getInstance( 'authmanager' ) + LoggerFactory::getInstance( 'authevents' ) ->info( 'Captcha shown on account creation', [ 'event' => 'captcha.display', 'type' => 'accountcreation', @@ -74,7 +74,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider $captcha->setAction( 'badlogin' ); $captcha->setTrigger( "post-badlogin login '$username'" ); $success = $this->verifyCaptcha( $captcha, $reqs, new User() ); - LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha submitted on login', [ + LoggerFactory::getInstance( 'authevents' )->info( 'Captcha submitted on login', [ 'event' => 'captcha.submit', 'type' => 'login', 'successful' => $success, @@ -99,7 +99,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider $captcha->setAction( 'accountcreate' ); $captcha->setTrigger( "new account '$username'" ); $success = $this->verifyCaptcha( $captcha, $reqs, $user ); - LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha submitted on account creation', [ + LoggerFactory::getInstance( 'authevents' )->info( 'Captcha submitted on account creation', [ 'event' => 'captcha.submit', 'type' => 'accountcreation', 'successful' => $success,