summaryrefslogtreecommitdiffstats
path: root/extensions/Persona/template/en/default
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-02-15 22:52:12 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-02-15 22:52:12 +0100
commit841c07890e9ce51a5884edbd63ecc10e1ff2fbf1 (patch)
tree00f72bae4ca8e7ca0d6351dca9a1d23515ff3fd6 /extensions/Persona/template/en/default
parenta21d718edfe6772b0e0a86eb5cb8937c7083bf5b (diff)
downloadbugzilla-841c07890e9ce51a5884edbd63ecc10e1ff2fbf1.tar.gz
bugzilla-841c07890e9ce51a5884edbd63ecc10e1ff2fbf1.tar.xz
Bug 820936 - Rename BrowserID extension to Persona
r=glob
Diffstat (limited to 'extensions/Persona/template/en/default')
-rw-r--r--extensions/Persona/template/en/default/admin/params/browserid.html.tmpl22
-rw-r--r--extensions/Persona/template/en/default/admin/params/persona.html.tmpl22
-rw-r--r--extensions/Persona/template/en/default/hook/account/auth/login-additional_methods.html.tmpl6
-rw-r--r--extensions/Persona/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl16
-rw-r--r--extensions/Persona/template/en/default/hook/account/create-additional_methods.html.tmpl31
-rw-r--r--extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl65
-rw-r--r--extensions/Persona/template/en/default/hook/global/user-error-errors.html.tmpl10
7 files changed, 172 insertions, 0 deletions
diff --git a/extensions/Persona/template/en/default/admin/params/browserid.html.tmpl b/extensions/Persona/template/en/default/admin/params/browserid.html.tmpl
new file mode 100644
index 000000000..379d12058
--- /dev/null
+++ b/extensions/Persona/template/en/default/admin/params/browserid.html.tmpl
@@ -0,0 +1,22 @@
+[%# 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.
+ #%]
+
+[%
+ title = "Persona"
+ desc = "Configure Persona Authentication"
+%]
+
+[% param_descs = {
+ persona_verify_url => "This is the URL for the Persona authority that the " _
+ "user will be verified against. " _
+ "Example: <kbd>https://verifier.login.persona.org/verify</kbd>.",
+ persona_includejs_url => "This is the URL needed by Persona to load the necessary " _
+ "javascript library for authentication. " _
+ "Example: <kbd>https://persona.org/include.js</kbd>."
+ }
+%]
diff --git a/extensions/Persona/template/en/default/admin/params/persona.html.tmpl b/extensions/Persona/template/en/default/admin/params/persona.html.tmpl
new file mode 100644
index 000000000..379d12058
--- /dev/null
+++ b/extensions/Persona/template/en/default/admin/params/persona.html.tmpl
@@ -0,0 +1,22 @@
+[%# 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.
+ #%]
+
+[%
+ title = "Persona"
+ desc = "Configure Persona Authentication"
+%]
+
+[% param_descs = {
+ persona_verify_url => "This is the URL for the Persona authority that the " _
+ "user will be verified against. " _
+ "Example: <kbd>https://verifier.login.persona.org/verify</kbd>.",
+ persona_includejs_url => "This is the URL needed by Persona to load the necessary " _
+ "javascript library for authentication. " _
+ "Example: <kbd>https://persona.org/include.js</kbd>."
+ }
+%]
diff --git a/extensions/Persona/template/en/default/hook/account/auth/login-additional_methods.html.tmpl b/extensions/Persona/template/en/default/hook/account/auth/login-additional_methods.html.tmpl
new file mode 100644
index 000000000..b76605948
--- /dev/null
+++ b/extensions/Persona/template/en/default/hook/account/auth/login-additional_methods.html.tmpl
@@ -0,0 +1,6 @@
+[% IF Param('user_info_class').split(',').contains('Persona')
+ && Param('persona_includejs_url') %]
+<p>
+ <img src="extensions/Persona/web/images/persona_sign_in.png" onclick="persona_sign_in()">
+</p>
+[% END %]
diff --git a/extensions/Persona/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl b/extensions/Persona/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl
new file mode 100644
index 000000000..0cee286bd
--- /dev/null
+++ b/extensions/Persona/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl
@@ -0,0 +1,16 @@
+[% IF Param('user_info_class').split(',').contains('Persona')
+ && Param('persona_includejs_url') %]
+<script type="text/javascript">
+ YAHOO.util.Event.addListener('login_link[% qs_suffix FILTER js %]','click', function () {
+ var login_link = YAHOO.util.Dom.get('persona_mini_login[% qs_suffix FILTER js %]');
+ YAHOO.util.Dom.removeClass(login_link, 'bz_default_hidden');
+ });
+ YAHOO.util.Event.addListener('hide_mini_login[% qs_suffix FILTER js %]','click', function () {
+ var login_link = YAHOO.util.Dom.get('persona_mini_login[% qs_suffix FILTER js %]');
+ YAHOO.util.Dom.addClass(login_link, 'bz_default_hidden');
+ });
+</script>
+<span id="persona_mini_login[% qs_suffix FILTER html %]" class="bz_default_hidden">
+ <img src="extensions/Persona/web/images/sign_in.png" height="22px" width="75px" align="absmiddle" onclick="persona_sign_in()"> or
+</span>
+[% END %]
diff --git a/extensions/Persona/template/en/default/hook/account/create-additional_methods.html.tmpl b/extensions/Persona/template/en/default/hook/account/create-additional_methods.html.tmpl
new file mode 100644
index 000000000..9bf95b780
--- /dev/null
+++ b/extensions/Persona/template/en/default/hook/account/create-additional_methods.html.tmpl
@@ -0,0 +1,31 @@
+[%# 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.
+ #%]
+
+[% IF Param('user_info_class').split(',').contains('Persona') %]
+<script type="text/javascript">
+function persona_create_account() {
+ navigator.id.getVerifiedEmail(function(assertion) {
+ if (assertion) {
+ // This code will be invoked once the user has successfully
+ // selected an email address they control to sign in with.
+ document.getElementById('persona_assertion').value = assertion;
+ document.getElementById('persona_form').submit();
+ return true;
+ }
+ });
+}
+</script>
+
+Or, use your Persona account:
+<img src="extensions/Persona/web/images/sign_in.png" onclick="persona_create_account()">
+
+<form id="persona_form" method="POST" action="index.cgi">
+ <input type="hidden" name="token" value="[% issue_hash_token(['login']) FILTER html %]">
+ <input type="hidden" name="persona_assertion" id="persona_assertion" value="">
+</form>
+[% END %]
diff --git a/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl b/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl
new file mode 100644
index 000000000..d4cc2132e
--- /dev/null
+++ b/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl
@@ -0,0 +1,65 @@
+[%# 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.
+ #%]
+
+[% RETURN IF user.login
+ || !Param('persona_includejs_url')
+ || !Param('user_info_class').split(',').contains('Persona') %]
+
+[% USE Bugzilla %]
+[% cgi = Bugzilla.cgi %]
+
+[% login_target = cgi.url("-relative" => 1, "-query" => 1) %]
+[% IF !login_target OR login_target.match("^token.cgi") %]
+ [% login_target = "index.cgi" %]
+[% END %]
+
+[% login_target = urlbase _ login_target %]
+
+<script src="[% Param('persona_includejs_url') %]" type="text/javascript"></script>
+
+<script type="text/javascript">
+function createHidden(name, value, form) {
+ var field = document.createElement('input');
+ field.type = 'hidden';
+ field.name = name;
+ field.value = value;;
+ form.appendChild(field);
+}
+
+function persona_sign_in() {
+ navigator.id.request({ siteName: '[% terms.BugzillaTitle FILTER js %]' });
+ navigator.id.watch({
+ loggedInUser: [% IF user.id %]'[% user.login FILTER js %]'[% ELSE %]null[% END %],
+ onlogin: function(assertion) {
+ var form = document.createElement('form');
+ form.action = '[% login_target FILTER js %]';
+ form.method = 'POST';
+ form.style.display = 'none';
+
+ createHidden('token', '[% issue_hash_token(['login']) FILTER js %]', form);
+ createHidden('Bugzilla_remember', 'on', form);
+ createHidden('persona_assertion', assertion, form);
+
+ [% FOREACH field = cgi.param() %]
+ [% NEXT IF field.search("^(Bugzilla_(login|password|restrictlogin)|token|persona_assertion)$") %]
+ [% FOREACH mvalue = cgi.param(field).slice(0) %]
+ createHidden('[% field FILTER js %]', '[% mvalue FILTER html_linebreak FILTER js %]', form);
+ [% END %]
+ [% END %]
+
+ document.body.appendChild(form);
+ form.submit();
+ return true;
+ },
+ onlogout: function () {
+ document.location = '[% urlbase FILTER none %]index.cgi?logout=1';
+ return true;
+ }
+ });
+}
+</script>
diff --git a/extensions/Persona/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/Persona/template/en/default/hook/global/user-error-errors.html.tmpl
new file mode 100644
index 000000000..bf7b865ac
--- /dev/null
+++ b/extensions/Persona/template/en/default/hook/global/user-error-errors.html.tmpl
@@ -0,0 +1,10 @@
+[% IF error == "persona_account_too_powerful" %]
+ [% title = "Account Too Powerful" %]
+ Your account is a member of a group which is not permitted to use
+ Persona to log in. Please log in with your [% terms.Bugzilla %] username
+ and password.
+ <br><br>
+ (Persona logins are disabled for accounts which are members of certain
+ particularly sensitive groups, while we gain experience with the
+ technology.)
+[% END %]