From d69cebd8c703f0a1f6839944f1c949bce350b02e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 13 Oct 2015 00:49:00 +0800 Subject: Bug 1199089 - add support for duo-security --- template/en/default/mfa/dummy/verify.html.tmpl | 28 ++++++++ template/en/default/mfa/duo/verify.html.tmpl | 95 ++++++++++++++++++++++++++ template/en/default/mfa/totp/enroll.html.tmpl | 2 - 3 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 template/en/default/mfa/dummy/verify.html.tmpl create mode 100644 template/en/default/mfa/duo/verify.html.tmpl (limited to 'template/en/default/mfa') diff --git a/template/en/default/mfa/dummy/verify.html.tmpl b/template/en/default/mfa/dummy/verify.html.tmpl new file mode 100644 index 000000000..9b9501e66 --- /dev/null +++ b/template/en/default/mfa/dummy/verify.html.tmpl @@ -0,0 +1,28 @@ +[%# 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. + #%] + +[% + INCLUDE global/header.html.tmpl + title = "Account Verification" +%] + +

Account Verification

+ +

+ [% reason FILTER html %] requires verification, and your configured + two-factor provider is no longer available. +

+ +
+ [% FOREACH field IN postback.fields.keys %] + + [% END %] + +
+ +[% INCLUDE global/footer.html.tmpl %] diff --git a/template/en/default/mfa/duo/verify.html.tmpl b/template/en/default/mfa/duo/verify.html.tmpl new file mode 100644 index 000000000..627b82039 --- /dev/null +++ b/template/en/default/mfa/duo/verify.html.tmpl @@ -0,0 +1,95 @@ +[%# 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. + #%] + +[% is_enrolment = action == "enable" %] + +[% js = BLOCK %] +$(function() { + + $('#recovery-toggle') + .click(function(event) { + event.preventDefault(); + + if ($('#duo_container').is(':visible')) { + $('#duo_container').hide(); + $('#recovery').show(); + $('#code').attr('required', true).focus(); + $('#recovery-submit').attr('disabled', false); + $(this).text('Verify using Duo Security'); + } + else { + $('#duo_container').show(); + $('#recovery').hide(); + $('#code').attr('required', false); + $('#recovery-submit').attr('disabled', true); + $(this).text('Verify using a recovery code'); + } + }); + +}); +[% END %] + +[% css = BLOCK %] + + #duo_container { + background: #fff url(skins/standard/throbber.gif) 10px 10px no-repeat; + width: 620px; + height: 330px; + border: 1px solid #000; + } + +[% END %] + +[% + INCLUDE global/header.html.tmpl + title = "Account Verification" + javascript_urls = ['js/duo-min.js'] + javascript = js + style = css +%] + +

Account Verification

+ +

+ [% reason FILTER html %] requires verification.
+ [% UNLESS is_enrolment %] + Verify using a recovery code. + [% END %] +

+ +
+ +
+ +
+ [% FOREACH field IN postback.fields.keys %] + + [% END %] + [% UNLESS is_enrolment %] + + [% END %] +
+ + + +[% INCLUDE global/footer.html.tmpl %] diff --git a/template/en/default/mfa/totp/enroll.html.tmpl b/template/en/default/mfa/totp/enroll.html.tmpl index 63fc74698..fda7689a5 100644 --- a/template/en/default/mfa/totp/enroll.html.tmpl +++ b/template/en/default/mfa/totp/enroll.html.tmpl @@ -7,7 +7,6 @@ #%] [% js = BLOCK %] - $(function() { $('#show-text') @@ -25,7 +24,6 @@ $(function() { }); }); - [% END %] [% css = BLOCK %] -- cgit v1.2.3-24-g4f1b