summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-04-11 18:02:18 +0200
committerByron Jones <bjones@mozilla.com>2012-04-11 18:02:18 +0200
commit8b3e405968a4611ff901000bdcb2ce4e6d4fd997 (patch)
tree4d70bcbeaa723461875896d0ef6ece67063f7341
parentc53605cca7a655e0206955a192ac9530fb270271 (diff)
downloadbugzilla-8b3e405968a4611ff901000bdcb2ce4e6d4fd997.tar.gz
bugzilla-8b3e405968a4611ff901000bdcb2ce4e6d4fd997.tar.xz
Bug 743643: add browserID button to createaccount page
-rw-r--r--extensions/BMO/template/en/default/account/create.html.tmpl4
-rw-r--r--extensions/BMO/web/styles/create_account.css4
-rw-r--r--extensions/BrowserID/lib/Login.pm5
-rw-r--r--extensions/BrowserID/template/en/default/hook/account/create-additional_methods.html.tmpl31
-rw-r--r--template/en/default/account/create.html.tmpl2
5 files changed, 41 insertions, 5 deletions
diff --git a/extensions/BMO/template/en/default/account/create.html.tmpl b/extensions/BMO/template/en/default/account/create.html.tmpl
index 6ca32dfd5..8bd4a9812 100644
--- a/extensions/BMO/template/en/default/account/create.html.tmpl
+++ b/extensions/BMO/template/en/default/account/create.html.tmpl
@@ -149,10 +149,12 @@ function onSubmit() {
<input type="hidden" id="token" name="token" value="[% issue_hash_token(['create_account']) FILTER html %]">
<input type="submit" value="Create Account">
</td>
- </tr>
+ </tr>
</table>
</form>
+ [% Hook.process('additional_methods') %]
+
</td>
</tr>
diff --git a/extensions/BMO/web/styles/create_account.css b/extensions/BMO/web/styles/create_account.css
index 27ea9912a..0ab527629 100644
--- a/extensions/BMO/web/styles/create_account.css
+++ b/extensions/BMO/web/styles/create_account.css
@@ -56,7 +56,7 @@
padding-bottom: 1em;
}
-#create-account-form {
- margin-bottom: 5em;
+#create-account-right {
+ padding-bottom: 5em;
}
diff --git a/extensions/BrowserID/lib/Login.pm b/extensions/BrowserID/lib/Login.pm
index 03d33cf6d..c3d87c958 100644
--- a/extensions/BrowserID/lib/Login.pm
+++ b/extensions/BrowserID/lib/Login.pm
@@ -31,8 +31,9 @@ use Bugzilla::Token;
use JSON;
use LWP::UserAgent;
-use constant requires_verification => 0;
-use constant is_automatic => 1;
+use constant requires_verification => 0;
+use constant is_automatic => 1;
+use constant user_can_create_account => 1;
sub get_login_info {
my ($self) = @_;
diff --git a/extensions/BrowserID/template/en/default/hook/account/create-additional_methods.html.tmpl b/extensions/BrowserID/template/en/default/hook/account/create-additional_methods.html.tmpl
new file mode 100644
index 000000000..6f75f5cd7
--- /dev/null
+++ b/extensions/BrowserID/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('BrowserID') %]
+<script type="text/javascript">
+function browserid_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();
+ return true;
+ }
+ });
+}
+</script>
+
+Or, use your BrowserID account:
+<img src="extensions/BrowserID/web/sign_in_orange.png" onclick="browserid_create_account()">
+
+<form id="browserid_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="">
+</form>
+[% END %]
diff --git a/template/en/default/account/create.html.tmpl b/template/en/default/account/create.html.tmpl
index 5acd9f541..985a54841 100644
--- a/template/en/default/account/create.html.tmpl
+++ b/template/en/default/account/create.html.tmpl
@@ -77,4 +77,6 @@
<input type="submit" id="send" value="Send">
</form>
+[% Hook.process('additional_methods') %]
+
[% PROCESS global/footer.html.tmpl %]