Skip to content

Instantly share code, notes, and snippets.

@dylanwh
Created May 17, 2020 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanwh/1e31327caa16604ce2e89954c4a2ebf9 to your computer and use it in GitHub Desktop.
Save dylanwh/1e31327caa16604ce2e89954c4a2ebf9 to your computer and use it in GitHub Desktop.
sub signup_email {
my ($c) = @_;
my $v = $c->validation;
try {
Bugzilla::User->new->check_account_creation_enabled;
my $email_regexp = Bugzilla->params->{createemailregexp};
$v->required('email')->like(qr/$email_regexp/);
$v->csrf_protect;
ThrowUserError('account_creation_restricted') unless $v->is_valid;
my $email = $v->param('email');
Bugzilla::User->check_login_name_for_creation($email);
Bugzilla::Hook::process("user_verify_login", {login => $email});
$c->issue_new_user_account_token($email);
$c->render(handler => 'bugzilla');
}
catch {
$c->bugzilla->error_page($_);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment