diff options
author | mkanat%bugzilla.org <> | 2009-12-31 13:53:19 +0100 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-12-31 13:53:19 +0100 |
commit | 8d2b07ea05e895f040d1805221135bfb68dc7f7c (patch) | |
tree | 0e7abffa238bf380bd944971915c247773abd93a /Bugzilla/Token.pm | |
parent | 1a4a843db26f6c3c208fa5dfdca7933b7cb76db2 (diff) | |
download | bugzilla-8d2b07ea05e895f040d1805221135bfb68dc7f7c.tar.gz bugzilla-8d2b07ea05e895f040d1805221135bfb68dc7f7c.tar.xz |
Bug 527586: Use X-Forwarded-For instead of REMOTE_ADDR for trusted proxies
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla/Token.pm')
-rw-r--r-- | Bugzilla/Token.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index 4aee0561e..2cd9e3f9c 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -142,7 +142,7 @@ sub IssuePasswordToken { ThrowUserError('too_soon_for_new_token', {'type' => 'password'}) if $too_soon; - my ($token, $token_ts) = _create_token($user->id, 'password', $::ENV{'REMOTE_ADDR'}); + my ($token, $token_ts) = _create_token($user->id, 'password', remote_ip()); # Mail the user the token along with instructions for using it. my $template = Bugzilla->template_inner($user->settings->{'lang'}->{'value'}); @@ -283,7 +283,7 @@ sub Cancel { my $user = new Bugzilla::User($userid); $vars->{'emailaddress'} = $userid ? $user->email : $eventdata; - $vars->{'remoteaddress'} = $::ENV{'REMOTE_ADDR'}; + $vars->{'remoteaddress'} = remote_ip(); $vars->{'token'} = $token; $vars->{'tokentype'} = $tokentype; $vars->{'issuedate'} = $issuedate; |