Remove EchoBasicFormatter - no longer in use

Cleanup LoginNotify

Bug: T151414
Change-Id: Idc8913ebd80418dc40fb97d0a92fb51de5b07abf
This commit is contained in:
niharika29 2017-01-23 15:43:50 +00:00 committed by Niharika29
parent 0682e17314
commit 03839f7d96
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": [