diff --git a/i18n/en.json b/i18n/en.json index c90709a1..855921e6 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -12,8 +12,10 @@ "oathauth-account": "Account name:", "oathauth-secret": "Two-factor authentication secret key:", "oathauth-enable": "Enable two-factor authentication", - "oathauth-recoverycodes": "The following list is a list of one-time use recovery codes. These codes can only be used once, and are for emergency use when you don't have access to your device. Please write these down and keep them in a secure location. It is recommended that you mark each code as used when you have logged in using it. If you lose your device, these codes are the only way to rescue your account.\n\n'''These codes will never be shown again'''.", + "oathauth-recoverycodes": "The following list is a list of one-time use recovery codes. These codes can only be used once, and are for emergency use when you don't have access to your device. Please write these down and keep them in a secure location. It is recommended that you mark each code as used when you have logged in using it. If you lose your device, these codes are the only way to rescue your account.", "oathauth-recoverycodes-important": "This step is important! Do not skip this step!", + "oathauth-recoverycodes-neveragain": "These codes will never be shown again!", + "oathauth-recoverytokens-createdat": "Recovery tokens created: $1", "oathauth-recoverycodes-download": "Download recovery codes", "oathauth-disable": "Disable two-factor authentication", "oathauth-validatedoath": "Validated two-factor credentials. Two-factor authentication will now be enforced.", diff --git a/i18n/qqq.json b/i18n/qqq.json index 1042e79e..ef2a20e3 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -29,6 +29,8 @@ "oathauth-enable": "Page title on Special:OATH, when enabling OATH.\n\nSee [https://en.wikipedia.org/wiki/Two_factor_authentication two factor authentication]", "oathauth-recoverycodes": "Plain text, found on Special:OATH while enabling OATH.", "oathauth-recoverycodes-important": "Plain text, found on Special:OATH while enabling OATH.", + "oathauth-recoverycodes-neveragain": "Plain text, found on Special:OATH while enabling OATH.", + "oathauth-recoverytokens-createdat": "Plain text, found on Special:OATH while enabling OATH.", "oathauth-recoverycodes-download": "Plain text, text of the download link on Special:OATH while enabling OATH.", "oathauth-disable": "Page title on Special:OATH while disabling OATH.\n\nSee [https://en.wikipedia.org/wiki/Two_factor_authentication two factor authentication]", "oathauth-validatedoath": "Plain text found on Special:OATH after a token has been validated.\n\nSee [https://en.wikipedia.org/wiki/Two_factor_authentication two factor authentication]", diff --git a/src/HTMLForm/TOTPEnableForm.php b/src/HTMLForm/TOTPEnableForm.php index 2b391026..ea6b65ac 100644 --- a/src/HTMLForm/TOTPEnableForm.php +++ b/src/HTMLForm/TOTPEnableForm.php @@ -68,6 +68,8 @@ class TOTPEnableForm extends OATHAuthOOUIHTMLForm { ->margin( 0 ) ->build(); + $now = wfTimestampNow(); + // messages used: oathauth-step1, oathauth-step2, oathauth-step3, oathauth-step4 return [ 'app' => [ @@ -103,10 +105,19 @@ class TOTPEnableForm extends OATHAuthOOUIHTMLForm { 'scratchtokens' => [ 'type' => 'info', 'default' => - '' . $this->msg( 'oathauth-recoverycodes-important' )->escaped() . '
' - . $this->msg( 'oathauth-recoverycodes' )->parse() - . $this->createResourceList( $this->getScratchTokensForDisplay( $key ) ) - . $this->createDownloadLink( $this->getScratchTokensForDisplay( $key ) ), + '' . $this->msg( 'oathauth-recoverycodes-important' )->escaped() . '
' . + $this->msg( 'oathauth-recoverycodes' )->escaped() . '

' . + $this->msg( 'rawmessage' )->rawParams( + $this->msg( + 'oathauth-recoverytokens-createdat', + $this->getLanguage()->userTimeAndDate( $now, $this->oathUser->getUser() ) + )->parse() + . $this->msg( 'word-separator' )->escaped() + . $this->msg( 'parentheses' )->rawParams( wfTimestamp( TS_ISO_8601, $now ) )->escaped() + ) . '
' . + $this->createResourceList( $this->getScratchTokensForDisplay( $key ) ) . '
' . + '' . $this->msg( 'oathauth-recoverycodes-neveragain' )->escaped() . '
' . + $this->createDownloadLink( $this->getScratchTokensForDisplay( $key ) ), 'raw' => true, 'section' => 'step3', ],