summaryrefslogtreecommitdiffstats
path: root/token.cgi
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2013-06-06 22:46:30 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2013-06-06 22:46:30 +0200
commita905395d7fd7dce12a8f51b68aaeede0959480b6 (patch)
tree689eaf2d1f1b10c62c70d815fd1baf51496818d0 /token.cgi
parentbb45718c677f941ef0ec214cf87ce6bb85f0fa4e (diff)
downloadbugzilla-a905395d7fd7dce12a8f51b68aaeede0959480b6.tar.gz
bugzilla-a905395d7fd7dce12a8f51b68aaeede0959480b6.tar.xz
Bug 878035: Do not disclose whether a user account exists or not when a user clicks "forgot password"
r=dkl a=LpSolit
Diffstat (limited to 'token.cgi')
-rwxr-xr-xtoken.cgi7
1 files changed, 4 insertions, 3 deletions
diff --git a/token.cgi b/token.cgi
index c1630ec91..030d264af 100755
--- a/token.cgi
+++ b/token.cgi
@@ -124,17 +124,18 @@ sub requestChangePassword {
or ThrowUserError("login_needed_for_password_change");
check_email_syntax($login_name);
- my $user = Bugzilla::User->check($login_name);
+ my $user = new Bugzilla::User({ name => $login_name });
# Make sure the user account is active.
- if (!$user->is_enabled) {
+ if ($user && !$user->is_enabled) {
ThrowUserError('account_disabled',
{disabled_reason => get_text('account_disabled', {account => $login_name})});
}
- Bugzilla::Token::IssuePasswordToken($user);
+ Bugzilla::Token::IssuePasswordToken($user) if $user;
$vars->{'message'} = "password_change_request";
+ $vars->{'login_name'} = $login_name;
print $cgi->header();
$template->process("global/message.html.tmpl", $vars)