summaryrefslogtreecommitdiffstats
path: root/extensions
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
parenta21d718edfe6772b0e0a86eb5cb8937c7083bf5b (diff)
downloadbugzilla-841c07890e9ce51a5884edbd63ecc10e1ff2fbf1.tar.gz
bugzilla-841c07890e9ce51a5884edbd63ecc10e1ff2fbf1.tar.xz
Bug 820936 - Rename BrowserID extension to Persona
r=glob
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BrowserID/Config.pm43
-rw-r--r--extensions/BrowserID/Extension.pm55
-rw-r--r--extensions/BrowserID/template/en/default/admin/params/browserid.html.tmpl22
-rw-r--r--extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl7
-rw-r--r--extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl16
-rw-r--r--extensions/BrowserID/web/sign_in_orange.pngbin2100 -> 0 bytes
-rw-r--r--extensions/Persona/Config.pm29
-rw-r--r--extensions/Persona/Extension.pm73
-rw-r--r--extensions/Persona/TODO (renamed from extensions/BrowserID/TODO)0
-rw-r--r--extensions/Persona/lib/Config.pm (renamed from extensions/BrowserID/lib/Config.pm)7
-rw-r--r--extensions/Persona/lib/Login.pm (renamed from extensions/BrowserID/lib/Login.pm)56
-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.tmpl (renamed from extensions/BrowserID/template/en/default/hook/account/create-additional_methods.html.tmpl)16
-rw-r--r--extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl (renamed from extensions/BrowserID/template/en/default/hook/global/header-additional_header.html.tmpl)24
-rw-r--r--extensions/Persona/template/en/default/hook/global/user-error-errors.html.tmpl (renamed from extensions/BrowserID/template/en/default/hook/global/user-error-errors.html.tmpl)8
-rw-r--r--extensions/Persona/web/images/persona_sign_in.pngbin0 -> 3684 bytes
-rw-r--r--extensions/Persona/web/images/sign_in.pngbin0 -> 1993 bytes
20 files changed, 219 insertions, 203 deletions
diff --git a/extensions/BrowserID/Config.pm b/extensions/BrowserID/Config.pm
deleted file mode 100644
index a55ea8ff0..000000000
--- a/extensions/BrowserID/Config.pm
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- Mode: perl; indent-tabs-mode: nil -*-
-#
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-#
-# The Original Code is the BrowserID Bugzilla Extension.
-#
-# The Initial Developer of the Original Code is the Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2011 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Gervase Markham <gerv@gerv.net>
-
-package Bugzilla::Extension::BrowserID;
-use strict;
-
-use constant NAME => 'BrowserID';
-
-use constant REQUIRED_MODULES => [
- {
- package => 'JSON',
- module => 'JSON',
- version => 0,
- },
- {
- package => 'libwww-perl',
- module => 'LWP::UserAgent',
- version => 0,
- },
-];
-
-use constant OPTIONAL_MODULES => [
-];
-
-__PACKAGE__->NAME;
diff --git a/extensions/BrowserID/Extension.pm b/extensions/BrowserID/Extension.pm
deleted file mode 100644
index f4d7e32b5..000000000
--- a/extensions/BrowserID/Extension.pm
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- Mode: perl; indent-tabs-mode: nil -*-
-#
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-#
-# The Original Code is the BrowserID Bugzilla Extension.
-#
-# The Initial Developer of the Original Code is the Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2011 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Gervase Markham <gerv@gerv.net>
-
-package Bugzilla::Extension::BrowserID;
-use strict;
-use base qw(Bugzilla::Extension);
-
-our $VERSION = '0.01';
-
-sub auth_login_methods {
- my ($self, $args) = @_;
- my $modules = $args->{'modules'};
- if (exists($modules->{'BrowserID'})) {
- $modules->{'BrowserID'} = 'Bugzilla/Extension/BrowserID/Login.pm';
- }
-}
-
-sub config_modify_panels {
- my ($self, $args) = @_;
- my $panels = $args->{'panels'};
- my $auth_panel_params = $panels->{'auth'}->{'params'};
-
- my ($user_info_class) =
- grep { $_->{'name'} eq 'user_info_class' } @$auth_panel_params;
-
- if ($user_info_class) {
- push(@{ $user_info_class->{'choices'} }, "BrowserID,CGI");
- }
-}
-
-sub config_add_panels {
- my ($self, $args) = @_;
- my $modules = $args->{panel_modules};
- $modules->{BrowserID} = "Bugzilla::Extension::BrowserID::Config";
-}
-
-__PACKAGE__->NAME;
diff --git a/extensions/BrowserID/template/en/default/admin/params/browserid.html.tmpl b/extensions/BrowserID/template/en/default/admin/params/browserid.html.tmpl
deleted file mode 100644
index e78dbb471..000000000
--- a/extensions/BrowserID/template/en/default/admin/params/browserid.html.tmpl
+++ /dev/null
@@ -1,22 +0,0 @@
-[%# 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 = "BrowserID"
- desc = "Configure BrowserID Authentication"
-%]
-
-[% param_descs = {
- browserid_verify_url => "This is the URL for the BrowserID authority that the " _
- "user will be verified against. " _
- "Example: <kbd>https://verifier.login.persona.org/verify</kbd>.",
- browserid_includejs_url => "This is the URL needed by BrowserID to load the necessary " _
- "javascript library for authentication. " _
- "Example: <kbd>https://browserid.org</kbd>."
- }
-%]
diff --git a/extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl b/extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl
deleted file mode 100644
index c79e1204e..000000000
--- a/extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-[% IF Param('user_info_class').split(',').contains('BrowserID')
- && Param('browserid_includejs_url') %]
-<p>
-Or, log in with BrowserID:
-<img src="extensions/BrowserID/web/sign_in_orange.png" onclick="browserid_sign_in()">
-</p>
-[% END %]
diff --git a/extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl b/extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl
deleted file mode 100644
index b14dd5d8e..000000000
--- a/extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl
+++ /dev/null
@@ -1,16 +0,0 @@
-[% IF Param('user_info_class').split(',').contains('BrowserID')
- && Param('browserid_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('browserid_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('browserid_mini_login[% qs_suffix FILTER js %]');
- YAHOO.util.Dom.addClass(login_link, 'bz_default_hidden');
- });
-</script>
-<span id="browserid_mini_login[% qs_suffix FILTER html %]" class="bz_default_hidden">
- <img src="extensions/BrowserID/web/sign_in_orange.png" onclick="browserid_sign_in()" style="margin-bottom: -8px"> or
-</span>
-[% END %]
diff --git a/extensions/BrowserID/web/sign_in_orange.png b/extensions/BrowserID/web/sign_in_orange.png
deleted file mode 100644
index 65ccda473..000000000
--- a/extensions/BrowserID/web/sign_in_orange.png
+++ /dev/null
Binary files differ
diff --git a/extensions/Persona/Config.pm b/extensions/Persona/Config.pm
new file mode 100644
index 000000000..8709655d1
--- /dev/null
+++ b/extensions/Persona/Config.pm
@@ -0,0 +1,29 @@
+# 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.
+
+package Bugzilla::Extension::Persona;
+use strict;
+
+use constant NAME => 'Persona';
+
+use constant REQUIRED_MODULES => [
+ {
+ package => 'JSON',
+ module => 'JSON',
+ version => 0,
+ },
+ {
+ package => 'libwww-perl',
+ module => 'LWP::UserAgent',
+ version => 0,
+ },
+];
+
+use constant OPTIONAL_MODULES => [
+];
+
+__PACKAGE__->NAME;
diff --git a/extensions/Persona/Extension.pm b/extensions/Persona/Extension.pm
new file mode 100644
index 000000000..f288702e8
--- /dev/null
+++ b/extensions/Persona/Extension.pm
@@ -0,0 +1,73 @@
+# 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.
+
+package Bugzilla::Extension::Persona;
+use strict;
+use base qw(Bugzilla::Extension);
+
+use Bugzilla::Config qw(SetParam write_params);
+
+our $VERSION = '0.01';
+
+sub install_update_db {
+ # The extension changed from BrowserID to Persona
+ # so we need to update user_info_class if this system
+ # was using BrowserID for verification.
+ my $params = Bugzilla->params || Bugzilla::Config::read_param_file();
+ my $user_info_class = $params->{'user_info_class'};
+ if ($user_info_class =~ /BrowserID/) {
+ $user_info_class =~ s/BrowserID/Persona/;
+ SetParam('user_info_class', $user_info_class);
+ write_params();
+ }
+}
+
+sub auth_login_methods {
+ my ($self, $args) = @_;
+ my $modules = $args->{'modules'};
+ if (exists($modules->{'Persona'})) {
+ $modules->{'Persona'} = 'Bugzilla/Extension/Persona/Login.pm';
+ }
+}
+
+sub config_modify_panels {
+ my ($self, $args) = @_;
+ my $panels = $args->{'panels'};
+ my $auth_panel_params = $panels->{'auth'}->{'params'};
+
+ my ($user_info_class) =
+ grep { $_->{'name'} eq 'user_info_class' } @$auth_panel_params;
+
+ if ($user_info_class) {
+ push(@{ $user_info_class->{'choices'} }, "Persona,CGI");
+ }
+
+ # The extension changed from BrowserID to Persona
+ # so we need to retain the current values for the new
+ # params that will be created.
+ my $params = Bugzilla->params || Bugzilla::Config::read_param_file();
+ my $verify_url = $params->{'browserid_verify_url'};
+ my $includejs_url = $params->{'browserid_includejs_url'};
+ if ($verify_url && $includejs_url) {
+ foreach my $param (@{ $panels->{'persona'}->{'params'} }) {
+ if ($param->{'name'} eq 'persona_verify_url') {
+ $param->{'default'} = $verify_url;
+ }
+ if ($param->{'name'} eq 'persona_includejs_url') {
+ $param->{'default'} = $includejs_url;
+ }
+ }
+ }
+}
+
+sub config_add_panels {
+ my ($self, $args) = @_;
+ my $modules = $args->{panel_modules};
+ $modules->{Persona} = "Bugzilla::Extension::Persona::Config";
+}
+
+__PACKAGE__->NAME;
diff --git a/extensions/BrowserID/TODO b/extensions/Persona/TODO
index ac94a3c42..ac94a3c42 100644
--- a/extensions/BrowserID/TODO
+++ b/extensions/Persona/TODO
diff --git a/extensions/BrowserID/lib/Config.pm b/extensions/Persona/lib/Config.pm
index 7ee90d813..99c547b16 100644
--- a/extensions/BrowserID/lib/Config.pm
+++ b/extensions/Persona/lib/Config.pm
@@ -4,7 +4,8 @@
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
-package Bugzilla::Extension::BrowserID::Config;
+
+package Bugzilla::Extension::Persona::Config;
use strict;
use warnings;
@@ -18,12 +19,12 @@ sub get_param_list {
my @param_list = (
{
- name => 'browserid_verify_url',
+ name => 'persona_verify_url',
type => 't',
default => 'https://verifier.login.persona.org/verify',
},
{
- name => 'browserid_includejs_url',
+ name => 'persona_includejs_url',
type => 't',
default => 'https://login.persona.org/include.js',
}
diff --git a/extensions/BrowserID/lib/Login.pm b/extensions/Persona/lib/Login.pm
index d87c6f15c..167cc799f 100644
--- a/extensions/BrowserID/lib/Login.pm
+++ b/extensions/Persona/lib/Login.pm
@@ -1,25 +1,11 @@
-# -*- Mode: perl; indent-tabs-mode: nil -*-
+# 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/.
#
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-#
-# The Original Code is the BrowserID Bugzilla Extension.
-#
-# The Initial Developer of the Original Code is the Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2011 the
-# Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Gervase Markham <gerv@gerv.net>
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
-package Bugzilla::Extension::BrowserID::Login;
+package Bugzilla::Extension::Persona::Login;
use strict;
use base qw(Bugzilla::Auth::Login);
@@ -40,28 +26,28 @@ sub get_login_info {
my $cgi = Bugzilla->cgi;
- my $assertion = $cgi->param("browserid_assertion");
+ my $assertion = $cgi->param("persona_assertion");
# Avoid the assertion being copied into any 'echoes' of the current URL
# in the page.
- $cgi->delete('browserid_assertion');
-
- if (!$assertion || !Bugzilla->params->{browserid_verify_url}) {
+ $cgi->delete('persona_assertion');
+
+ if (!$assertion || !Bugzilla->params->{persona_verify_url}) {
return { failure => AUTH_NODATA };
}
-
+
my $token = $cgi->param("token");
$cgi->delete('token');
check_hash_token($token, ['login']);
my $urlbase = new URI(correct_urlbase());
my $audience = $urlbase->scheme . "://" . $urlbase->host_port;
-
+
my $ua = new LWP::UserAgent();
-
- my $info = { 'status' => 'browserid-server-broken' };
+
+ my $info = { 'status' => 'persona-server-broken' };
eval {
- my $response = $ua->post(Bugzilla->params->{browserid_verify_url},
- [assertion => $assertion,
+ my $response = $ua->post(Bugzilla->params->{persona_verify_url},
+ [assertion => $assertion,
audience => $audience]);
$info = decode_json($response->content());
@@ -76,13 +62,13 @@ sub get_login_info {
};
my $result =
- Bugzilla::Auth::Verify->create_or_update_user($login_data);
+ Bugzilla::Auth::Verify->create_or_update_user($login_data);
return $result if $result->{'failure'};
my $user = $result->{'user'};
-
+
# You can restrict people in a particular group from logging in using
- # BrowserID by making that group a member of a group called
+ # Persona by making that group a member of a group called
# "no-browser-id".
#
# If you have your "createemailregexp" set up in such a way that a
@@ -93,9 +79,9 @@ sub get_login_info {
if ($user->in_group('no-browser-id')) {
# We use a custom error here, for greater clarity, rather than
# returning a failure code.
- ThrowUserError('browserid_account_too_powerful');
+ ThrowUserError('persona_account_too_powerful');
}
-
+
$login_data->{'user'} = $user;
$login_data->{'user_id'} = $user->id;
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/BrowserID/template/en/default/hook/account/create-additional_methods.html.tmpl b/extensions/Persona/template/en/default/hook/account/create-additional_methods.html.tmpl
index 6f75f5cd7..9bf95b780 100644
--- a/extensions/BrowserID/template/en/default/hook/account/create-additional_methods.html.tmpl
+++ b/extensions/Persona/template/en/default/hook/account/create-additional_methods.html.tmpl
@@ -6,26 +6,26 @@
# defined by the Mozilla Public License, v. 2.0.
#%]
-[% IF Param('user_info_class').split(',').contains('BrowserID') %]
+[% IF Param('user_info_class').split(',').contains('Persona') %]
<script type="text/javascript">
-function browserid_create_account() {
+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('browserid_assertion').value = assertion;
- document.getElementById('browserid_form').submit();
+ document.getElementById('persona_assertion').value = assertion;
+ document.getElementById('persona_form').submit();
return true;
}
});
}
</script>
-Or, use your BrowserID account:
-<img src="extensions/BrowserID/web/sign_in_orange.png" onclick="browserid_create_account()">
+Or, use your Persona account:
+<img src="extensions/Persona/web/images/sign_in.png" onclick="persona_create_account()">
-<form id="browserid_form" method="POST" action="index.cgi">
+<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="browserid_assertion" id="browserid_assertion" value="">
+ <input type="hidden" name="persona_assertion" id="persona_assertion" value="">
</form>
[% END %]
diff --git a/extensions/BrowserID/template/en/default/hook/global/header-additional_header.html.tmpl b/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl
index 2292edf7f..d4cc2132e 100644
--- a/extensions/BrowserID/template/en/default/hook/global/header-additional_header.html.tmpl
+++ b/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl
@@ -7,8 +7,8 @@
#%]
[% RETURN IF user.login
- || !Param('browserid_includejs_url')
- || !Param('user_info_class').split(',').contains('BrowserID') %]
+ || !Param('persona_includejs_url')
+ || !Param('user_info_class').split(',').contains('Persona') %]
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
@@ -20,7 +20,7 @@
[% login_target = urlbase _ login_target %]
-<script src="[% Param('browserid_includejs_url') %]" type="text/javascript"></script>
+<script src="[% Param('persona_includejs_url') %]" type="text/javascript"></script>
<script type="text/javascript">
function createHidden(name, value, form) {
@@ -31,11 +31,11 @@ function createHidden(name, value, form) {
form.appendChild(field);
}
-function browserid_sign_in() {
- navigator.id.get(function(assertion) {
- if (assertion) {
- // This code will be invoked once the user has successfully
- // selected an email address they control to sign in with.
+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';
@@ -43,10 +43,10 @@ function browserid_sign_in() {
createHidden('token', '[% issue_hash_token(['login']) FILTER js %]', form);
createHidden('Bugzilla_remember', 'on', form);
- createHidden('browserid_assertion', assertion, form);
+ createHidden('persona_assertion', assertion, form);
[% FOREACH field = cgi.param() %]
- [% NEXT IF field.search("^(Bugzilla_(login|password|restrictlogin)|token|browserid_assertion)$") %]
+ [% 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 %]
@@ -55,6 +55,10 @@ function browserid_sign_in() {
document.body.appendChild(form);
form.submit();
return true;
+ },
+ onlogout: function () {
+ document.location = '[% urlbase FILTER none %]index.cgi?logout=1';
+ return true;
}
});
}
diff --git a/extensions/BrowserID/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/Persona/template/en/default/hook/global/user-error-errors.html.tmpl
index ce872abda..bf7b865ac 100644
--- a/extensions/BrowserID/template/en/default/hook/global/user-error-errors.html.tmpl
+++ b/extensions/Persona/template/en/default/hook/global/user-error-errors.html.tmpl
@@ -1,10 +1,10 @@
-[% IF error == "browserid_account_too_powerful" %]
+[% IF error == "persona_account_too_powerful" %]
[% title = "Account Too Powerful" %]
- Your account is a member of a group which is not permitted to use
- BrowserID to log in. Please log in with your [% terms.Bugzilla %] username
+ 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>
- (BrowserID logins are disabled for accounts which are members of certain
+ (Persona logins are disabled for accounts which are members of certain
particularly sensitive groups, while we gain experience with the
technology.)
[% END %]
diff --git a/extensions/Persona/web/images/persona_sign_in.png b/extensions/Persona/web/images/persona_sign_in.png
new file mode 100644
index 000000000..ab88a7154
--- /dev/null
+++ b/extensions/Persona/web/images/persona_sign_in.png
Binary files differ
diff --git a/extensions/Persona/web/images/sign_in.png b/extensions/Persona/web/images/sign_in.png
new file mode 100644
index 000000000..82594ba82
--- /dev/null
+++ b/extensions/Persona/web/images/sign_in.png
Binary files differ