--- /dev/null
+#!/usr/bin/env perl
+# 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.
+
+use 5.10.1;
+use strict;
+use warnings;
+
+use lib qw(. lib local/lib/perl5);
+
+use Bugzilla;
+use Bugzilla::Constants;
+use Bugzilla::Error;
+use Bugzilla::Token;
+
+# Just in case someone already has an account, let them get the correct footer
+# on an error message. The user is logged out just after the account is
+# actually created.
+my $user = Bugzilla->login(LOGIN_OPTIONAL);
+my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {doc_section => 'myaccount.html'};
+
+print $cgi->header();
+
+$user->check_account_creation_enabled;
+my $login = $cgi->param('login');
+
+if (defined($login)) {
+
+ # Check the hash token to make sure this user actually submitted
+ # the create account form.
+ my $token = $cgi->param('token');
+ check_hash_token($token, ['create_account']);
+
+ $user->check_and_send_account_creation_confirmation($login);
+ $vars->{'login'} = $login;
+
+ $template->process("account/created.html.tmpl", $vars)
+ || ThrowTemplateError($template->error());
+ exit;
+}
+
+# Show the standard "would you like to create an account?" form.
+$template->process("account/create.html.tmpl", $vars)
+ || ThrowTemplateError($template->error());
--- /dev/null
+[%# 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 Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is Netscape Communications
+ # Corporation. Portions created by Netscape are
+ # Copyright (C) 1998 Netscape Communications Corporation. All
+ # Rights Reserved.
+ #
+ # Contributor(s): Jacob Steenhagen <jake@bugzilla.org>
+ #%]
+
+ <form action="[% c.url_for('signup_email') FILTER html %]" method="post"
+ data-qs-suffix="[% qs_suffix FILTER html %]">
+
+ <input id="signup_email[% qs_suffix FILTER html %]"
+ class="bz_signup"
+ name="email"
+ title="Email"
+ placeholder="Email"
+ aria-label="Email"
+ type="email"
+ required
+ >
+ <input type="hidden" name="csrf_token"
+ value="[% c.csrf_token FILTER html %]">
+ <input type="submit" value="Sign up"
+ class="check_mini_signup_fields"
+ id="signup_[% qs_suffix FILTER html %]">
+ <a href="#" id="hide_mini_signup[% qs_suffix FILTER html %]" aria-label="Close"
+ class="close-button hide_mini_signup_form" data-qs-suffix="[% qs_suffix FILTER html %]">
+ <span class="icon" aria-hidden="true"></span>
+ </a>
+ </form>
# then we are accessing the home page. %]
<li id="mini_signup_container[% qs_suffix FILTER html %]">
- <a id="signup_link[% qs_suffix FILTER html %]" href="#"
+ <a id="signup_link[% qs_suffix FILTER html %]" href="[% urlbase FILTER html %]createaccount.cgi"
class='show_mini_signup_form' data-qs-suffix="[% qs_suffix FILTER html %]">Sign Up</a>
<div id="mini_signup[% qs_suffix FILTER html %]" class="mini-popup mini_signup bz_default_hidden">
[% Hook.process('additional_methods') %]
- <form action="[% c.url_for('signup_email') FILTER html %]" method="post"
- data-qs-suffix="[% qs_suffix FILTER html %]">
-
- <input id="signup_email[% qs_suffix FILTER html %]"
- class="bz_signup"
- name="email"
- title="Email"
- placeholder="Email"
- aria-label="Email"
- type="email"
- required
- >
- <input type="hidden" name="csrf_token"
- value="[% c.csrf_token FILTER html %]">
- <input type="submit" value="Sign up"
- class="check_mini_signup_fields"
- id="signup_[% qs_suffix FILTER html %]">
- <a href="#" id="hide_mini_signup[% qs_suffix FILTER html %]" aria-label="Close"
- class="close-button hide_mini_signup_form" data-qs-suffix="[% qs_suffix FILTER html %]">
- <span class="icon" aria-hidden="true"></span>
- </a>
- </form>
+ [% PROCESS "account/auth/signup-form.html.tmpl" %]
</div>
</li>
</p>
[% END %]
-<form id="account_creation_form" method="get" action="[% basepath FILTER none %]createaccount.cgi">
- <table>
- <tr>
- <td align="right">
- <b>Email address:</b>
- </td>
- <td>
- <input size="35" id="login" name="login"
- [%- ' type="email"' UNLESS Param('emailsuffix') %]>
- [% Param('emailsuffix') FILTER html %]
- </td>
- </tr>
- </table>
- <br>
- <input type="hidden" id="token" name="token" value="[% issue_hash_token(['create_account']) FILTER html %]">
- <input type="submit" id="send" value="Send">
-</form>
+[% PROCESS "account/auth/signup-form.html.tmpl" %]
[% Hook.process('additional_methods') %]