summaryrefslogtreecommitdiffstats
path: root/createaccount.cgi
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2016-04-27 18:50:13 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2016-04-27 18:50:13 +0200
commit3891b63a1eb52076337885487f251a10580a4a85 (patch)
treedb1463894b756a6bb5114644feeec704ec886eb5 /createaccount.cgi
parentc44470a368465adfe329fcfc32492829a21878da (diff)
downloadbugzilla-3891b63a1eb52076337885487f251a10580a4a85.tar.gz
bugzilla-3891b63a1eb52076337885487f251a10580a4a85.tar.xz
Bug 218917 - Allow the login name to be different from the email address
Original patch by Gervase Markham r=gerv a=dkl
Diffstat (limited to 'createaccount.cgi')
-rwxr-xr-xcreateaccount.cgi9
1 files changed, 6 insertions, 3 deletions
diff --git a/createaccount.cgi b/createaccount.cgi
index 754b1b552..3b3dd7c1f 100755
--- a/createaccount.cgi
+++ b/createaccount.cgi
@@ -27,22 +27,25 @@ my $vars = { doc_section => 'using/creating-an-account.html' };
print $cgi->header();
-my $login = $cgi->param('login');
+my $email = $cgi->param('email');
+my $login = Bugzilla->params->{'use_email_as_login'} ? $email : $cgi->param('login');
+
my $request_new_password = $cgi->param('request_new_password');
if ($request_new_password) {
$template->process('account/request-new-password.html.tmpl', $vars)
|| ThrowTemplateError($template->error());
}
-elsif (defined($login)) {
+elsif ($email && $login) {
$user->check_account_creation_enabled;
# 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);
+ $user->check_and_send_account_creation_confirmation($login, $email);
$vars->{'login'} = $login;
+ $vars->{'email'} = $email;
$template->process("account/created.html.tmpl", $vars)
|| ThrowTemplateError($template->error());