mediawiki-extensions-LoginN.../LoginNotifyPresentationModel.php
Brian Wolff fea1a38de5 Initial version of extension to notify people on failed login attempts.
Bug: T11838
Change-Id: Id96aff70f06879a7b754b19af8e65c0f641e84e0
2016-03-28 04:29:04 -04:00

45 lines
905 B
PHP

<?php
class LoginNotifyPresentationModel extends EchoEventPresentationModel {
/**
* Show a lock icon, for account security.
*
* @return String Name of icon
*/
public function getIconType() {
return 'LoginNotify-lock';
}
/**
* Nothing really to link to
*
* @return boolean false to disable link
*/
public function getPrimaryLink() {
return false;
}
/**
* Include the number of attempts in the message
*
* (For grep) This uses i18n messages:
* notification-header-login-fail-known
* notification-header-login-fail-new
* notification-header-login-success
*
* @return Message
*/
public function getHeaderMessage() {
return parent::getHeaderMessage()->numParams(
$this->event->getExtraParam( 'count', 0 )
);
}
/**
* @todo FIXME Unclear if this is a good idea
*/
public function getSecondaryLinks() {
return array( $this->getAgentLink() );
}
}