Merge "Rename 'authmanager' log channel to 'authevents'"

This commit is contained in:
jenkins-bot 2016-08-10 17:18:17 +00:00 committed by Gerrit Code Review
commit b3924fe2ba
2 changed files with 13 additions and 16 deletions

View file

@ -272,7 +272,7 @@ class SimpleCaptcha {
wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" ); wfDebug( "ConfirmEdit: user group allows skipping captcha on account creation\n" );
return true; return true;
} }
LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha shown on account creation', [ LoggerFactory::getInstance( 'authevents' )->info( 'Captcha shown on account creation', [
'event' => 'captcha.display', 'event' => 'captcha.display',
'type' => 'accountcreation', 'type' => 'accountcreation',
] ); ] );
@ -322,7 +322,7 @@ class SimpleCaptcha {
if ( $perIPTriggered || $perUserTriggered ) { if ( $perIPTriggered || $perUserTriggered ) {
global $wgOut; global $wgOut;
LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha shown on login', [ LoggerFactory::getInstance( 'authevents' )->info( 'Captcha shown on login', [
'event' => 'captcha.display', 'event' => 'captcha.display',
'type' => 'login', 'type' => 'login',
'perIp' => $perIPTriggered, 'perIp' => $perIPTriggered,
@ -943,9 +943,7 @@ class SimpleCaptcha {
if ( $this->needCreateAccountCaptcha() ) { if ( $this->needCreateAccountCaptcha() ) {
$this->trigger = "new account '" . $u->getName() . "'"; $this->trigger = "new account '" . $u->getName() . "'";
$success = $this->passCaptchaLimitedFromRequest( $wgRequest, $wgUser ); $success = $this->passCaptchaLimitedFromRequest( $wgRequest, $wgUser );
LoggerFactory::getInstance( LoggerFactory::getInstance( 'authevents' )->info( 'Captcha submitted on account creation', [
'authmanager'
)->info( 'Captcha submitted on account creation', [
'event' => 'captcha.submit', 'event' => 'captcha.submit',
'type' => 'accountcreation', 'type' => 'accountcreation',
'successful' => $success, 'successful' => $success,
@ -1008,7 +1006,7 @@ class SimpleCaptcha {
$this->trigger = "post-badlogin login '" . $u->getName() . "'"; $this->trigger = "post-badlogin login '" . $u->getName() . "'";
$success = $this->passCaptchaLimitedFromRequest( $wgRequest, $wgUser ); $success = $this->passCaptchaLimitedFromRequest( $wgRequest, $wgUser );
LoggerFactory::getInstance( 'authmanager' )->info( 'Captcha submitted on login', [ LoggerFactory::getInstance( 'authevents' )->info( 'Captcha submitted on login', [
'event' => 'captcha.submit', 'event' => 'captcha.submit',
'type' => 'login', 'type' => 'login',
'successful' => $success, 'successful' => $success,
@ -1349,12 +1347,11 @@ class SimpleCaptcha {
$this->addCaptchaAPI( $result ); $this->addCaptchaAPI( $result );
$result['result'] = 'NeedCaptcha'; $result['result'] = 'NeedCaptcha';
LoggerFactory::getInstance( LoggerFactory::getInstance( 'authevents' )
'authmanager' ->info( 'Captcha data added in account creation API', [
)->info( 'Captcha data added in account creation API', [ 'event' => 'captcha.display',
'event' => 'captcha.display', 'type' => 'accountcreation',
'type' => 'accountcreation', ] );
] );
break; break;
} }

View file

@ -17,7 +17,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider
$needed = $captcha->needCreateAccountCaptcha( $user ?: new User() ); $needed = $captcha->needCreateAccountCaptcha( $user ?: new User() );
if ( $needed ) { if ( $needed ) {
$captcha->setAction( 'accountcreate' ); $captcha->setAction( 'accountcreate' );
LoggerFactory::getInstance( 'authmanager' ) LoggerFactory::getInstance( 'authevents' )
->info( 'Captcha shown on account creation', [ ->info( 'Captcha shown on account creation', [
'event' => 'captcha.display', 'event' => 'captcha.display',
'type' => 'accountcreation', 'type' => 'accountcreation',
@ -46,7 +46,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider
) { ) {
$needed = true; $needed = true;
$captcha->setAction( 'badlogin' ); $captcha->setAction( 'badlogin' );
LoggerFactory::getInstance( 'authmanager' ) LoggerFactory::getInstance( 'authevents' )
->info( 'Captcha shown on account creation', [ ->info( 'Captcha shown on account creation', [
'event' => 'captcha.display', 'event' => 'captcha.display',
'type' => 'accountcreation', 'type' => 'accountcreation',
@ -74,7 +74,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider
$captcha->setAction( 'badlogin' ); $captcha->setAction( 'badlogin' );
$captcha->setTrigger( "post-badlogin login '$username'" ); $captcha->setTrigger( "post-badlogin login '$username'" );
$success = $this->verifyCaptcha( $captcha, $reqs, new User() ); $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', 'event' => 'captcha.submit',
'type' => 'login', 'type' => 'login',
'successful' => $success, 'successful' => $success,
@ -99,7 +99,7 @@ class CaptchaPreAuthenticationProvider extends AbstractPreAuthenticationProvider
$captcha->setAction( 'accountcreate' ); $captcha->setAction( 'accountcreate' );
$captcha->setTrigger( "new account '$username'" ); $captcha->setTrigger( "new account '$username'" );
$success = $this->verifyCaptcha( $captcha, $reqs, $user ); $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', 'event' => 'captcha.submit',
'type' => 'accountcreation', 'type' => 'accountcreation',
'successful' => $success, 'successful' => $success,