mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-15 03:04:08 +00:00
Merge "Remove EchoBasicFormatter - no longer in use"
This commit is contained in:
commit
0424755035
|
@ -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 ) {
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,8 +22,7 @@
|
|||
"AutoloadClasses": {
|
||||
"LoginNotify": "LoginNotify_body.php",
|
||||
"LoginNotifyHooks": "LoginNotify.hooks.php",
|
||||
"LoginNotifyPresentationModel": "LoginNotifyPresentationModel.php",
|
||||
"LoginNotifyFormatter": "LoginNotifyFormatter.php"
|
||||
"LoginNotifyPresentationModel": "LoginNotifyPresentationModel.php"
|
||||
},
|
||||
"Hooks": {
|
||||
"BeforeCreateEchoEvent": [
|
||||
|
|
Loading…
Reference in a new issue