Page MenuHomeWickedGov Phorge

RecoveryCodeCountPresentationModel.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

RecoveryCodeCountPresentationModel.php

<?php
namespace MediaWiki\Extension\OATHAuth\Notifications;
use MediaWiki\Extension\Notifications\Formatters\EchoEventPresentationModel;
use MediaWiki\Extension\OATHAuth\Key\TOTPKey;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Title\Title;
class RecoveryCodeCountPresentationModel extends EchoEventPresentationModel {
/** @inheritDoc */
public function getIconType() {
return 'site';
}
/** @inheritDoc */
public function getPrimaryLink() {
return [
'url' => SpecialPage::getTitleFor( 'OATHManage' )->getLocalURL(),
'label' => $this->msg( 'oathauth-notifications-recoverycodesleft-primary' )->text()
];
}
/** @inheritDoc */
public function getSecondaryLinks() {
$link = $this->msg( 'oathauth-notifications-recoverycodesleft-helplink' )->inContentLanguage();
$title = Title::newFromText( $link->plain() );
if ( !$title ) {
// Invalid title, skip
return [];
}
return [ [
'url' => $title->getLocalURL(),
'label' => $this->msg( 'oathauth-notifications-recoverycodesleft-help' )->text(),
'icon' => 'help',
] ];
}
/** @inheritDoc */
public function getBodyMessage() {
$msg = $this->getMessageWithAgent( 'notification-body-oathauth-recoverycodesleft' );
$msg->params( $this->event->getExtraParam( 'codeCount', 0 ) );
$msg->params( $this->event->getExtraParam( 'generatedCount', TOTPKey::RECOVERY_CODES_COUNT ) );
return $msg;
}
}

File Metadata

Mime Type
text/x-php
Expires
Aug 19 2026, 17:35 (5 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
00/2d/7629f9b111145b82d2c3a0357e55
Default Alt Text
RecoveryCodeCountPresentationModel.php (1 KB)

Event Timeline