From 05fed61671067cb6a750d41909ccb5692ba43808 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 29 Sep 2015 22:57:02 +0800 Subject: Bug 1199090 - add printable recovery 2fa codes --- template/en/default/account/prefs/mfa.html.tmpl | 88 ++++++++++++++++++------- template/en/default/mfa/recovery.html.tmpl | 35 ++++++++++ template/en/default/mfa/totp/verify.html.tmpl | 2 +- 3 files changed, 99 insertions(+), 26 deletions(-) create mode 100644 template/en/default/mfa/recovery.html.tmpl (limited to 'template') diff --git a/template/en/default/account/prefs/mfa.html.tmpl b/template/en/default/account/prefs/mfa.html.tmpl index 5aed954f9..df272f7d3 100644 --- a/template/en/default/account/prefs/mfa.html.tmpl +++ b/template/en/default/account/prefs/mfa.html.tmpl @@ -23,7 +23,19 @@ [% END %]
- [% IF user.mfa %] + [% IF mfa_recovery_token %] + + +

+ Here are your recovery codes. +

+ + [% INCLUDE recovery_blurb %] + + + [% ELSIF user.mfa %]

Two-factor authentication is currently enabled using [% SWITCH user.mfa %] @@ -32,30 +44,15 @@

- - [% INCLUDE "mfa/protected.html.tmpl" %] - -
+ +[% BLOCK recovery_blurb %] + +[% END %] diff --git a/template/en/default/mfa/recovery.html.tmpl b/template/en/default/mfa/recovery.html.tmpl new file mode 100644 index 000000000..b76d53ae9 --- /dev/null +++ b/template/en/default/mfa/recovery.html.tmpl @@ -0,0 +1,35 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% css = BLOCK %] + +#codes { + font-size: 100%; + font-family: monospace; +} + +[% END %] + +[% + PROCESS global/header.html.tmpl + style_urls = ['skins/standard/admin.css'] + no_body = 1 + style = css +%] + + [% IF codes.size %] +
+ [% FOREACH code IN codes %] + [% code FILTER html %]
+ [% END %] +
+ [% ELSE %] + Codes already generated + [% END %] + + diff --git a/template/en/default/mfa/totp/verify.html.tmpl b/template/en/default/mfa/totp/verify.html.tmpl index e61ee3866..ad75dc6bc 100644 --- a/template/en/default/mfa/totp/verify.html.tmpl +++ b/template/en/default/mfa/totp/verify.html.tmpl @@ -22,7 +22,7 @@ [% END %]

-- cgit v1.2.3-24-g4f1b