Merge "Remove EchoBasicFormatter - no longer in use"

This commit is contained in:
jenkins-bot 2017-02-01 03:37:08 +00:00 committed by Gerrit Code Review
commit 0424755035
3 changed files with 3 additions and 26 deletions

View file

@ -55,7 +55,6 @@ class LoginNotifyHooks {
// we have immediate flag?
'icon' => 'LoginNotify-lock',
'immediate' => true,
'formatter-class' => 'LoginNotifyFormatter',
];
$notifications['login-fail-new'] = [
'email-body-batch-message' => 'notification-loginnotify-login-fail-new-emailbatch'
@ -87,7 +86,6 @@ class LoginNotifyHooks {
* @param $user User User in question
* @param $pass String password
* @param $retval int LoginForm constant (e.g. LoginForm::SUCCESS)
* @return bool Standard hook return
*/
public static function onLoginAuthenticateAudit( User $user, $pass, $retval ) {
if ( !class_exists( 'EchoEvent' ) ) {
@ -173,7 +171,7 @@ class LoginNotifyHooks {
return true;
}
if ( !self::isUserOptionOverriden( $user, $wgLoginNotifyEnableForPriv ) ) {
if ( !self::isUserOptionOverriden( $user ) ) {
return true;
}
@ -210,10 +208,9 @@ class LoginNotifyHooks {
* @return bool
*/
public function onUserSaveOptions( User $user, array &$options ) {
global $wgLoginNotifyEnableForPriv;
$optionsToCheck = self::getOverridenOptions();
$defaultOpts = User::getDefaultOptions();
if ( !self::isUserOptionOverriden( $user, $wgLoginNotifyEnableForPriv ) ) {
if ( !self::isUserOptionOverriden( $user ) ) {
return true;
}
foreach ( $optionsToCheck as $opt ) {

View file

@ -1,19 +0,0 @@
<?php
class LoginNotifyFormatter extends EchoBasicFormatter {
/**
* Add the number of attempts as a param to the email.
*
* @param $event EchoEvent
* @param $param
* @param $message Message
* @param $user User
*/
protected function processParam( $event, $param, $message, $user ) {
if ( $param === 'count' ) {
$message->params( $event->getExtraParam( 'count' ) );
} else {
parent::processParam( $event, $param, $message, $user );
}
}
}

View file

@ -22,8 +22,7 @@
"AutoloadClasses": {
"LoginNotify": "LoginNotify_body.php",
"LoginNotifyHooks": "LoginNotify.hooks.php",
"LoginNotifyPresentationModel": "LoginNotifyPresentationModel.php",
"LoginNotifyFormatter": "LoginNotifyFormatter.php"
"LoginNotifyPresentationModel": "LoginNotifyPresentationModel.php"
},
"Hooks": {
"BeforeCreateEchoEvent": [