summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-01-08 17:09:46 +0100
committerlpsolit%gmail.com <>2009-01-08 17:09:46 +0100
commit558994bed534a4c979f6df8c2fba7d8c96c7d073 (patch)
tree697d20d0224be06cc68d2af93884a0aa49361707 /Bugzilla
parent11fa9ce3596363a4d4badd7960ae73e8dc535050 (diff)
downloadbugzilla-558994bed534a4c979f6df8c2fba7d8c96c7d073.tar.gz
bugzilla-558994bed534a4c979f6df8c2fba7d8c96c7d073.tar.xz
Bug 452519: Fix timezones in emails - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Token.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm
index 157cc0622..313d43212 100644
--- a/Bugzilla/Token.pm
+++ b/Bugzilla/Token.pm
@@ -74,7 +74,7 @@ sub issue_new_user_account_token {
my ($token, $token_ts) = _create_token(undef, 'account', $login_name);
$vars->{'email'} = $login_name . Bugzilla->params->{'emailsuffix'};
- $vars->{'token_ts'} = $token_ts;
+ $vars->{'expiration_ts'} = ctime($token_ts + MAX_TOKEN_AGE * 86400);
$vars->{'token'} = $token;
my $message;
@@ -103,10 +103,7 @@ sub IssueEmailChangeToken {
$vars->{'oldemailaddress'} = $old_email . $email_suffix;
$vars->{'newemailaddress'} = $new_email . $email_suffix;
-
- $vars->{'max_token_age'} = MAX_TOKEN_AGE;
- $vars->{'token_ts'} = $token_ts;
-
+ $vars->{'expiration_ts'} = ctime($token_ts + MAX_TOKEN_AGE * 86400);
$vars->{'token'} = $token;
$vars->{'emailaddress'} = $old_email . $email_suffix;
@@ -151,8 +148,10 @@ sub IssuePasswordToken {
$vars->{'token'} = $token;
$vars->{'emailaddress'} = $user->email;
- $vars->{'max_token_age'} = MAX_TOKEN_AGE;
- $vars->{'token_ts'} = $token_ts;
+ $vars->{'expiration_ts'} = ctime($token_ts + MAX_TOKEN_AGE * 86400);
+ # The user is not logged in (else he wouldn't request a new password).
+ # So we have to pass this information to the template.
+ $vars->{'timezone'} = $user->timezone;
my $message = "";
$template->process("account/password/forgotten-password.txt.tmpl",
@@ -233,6 +232,9 @@ sub Cancel {
$vars->{'token'} = $token;
$vars->{'tokentype'} = $tokentype;
$vars->{'issuedate'} = $issuedate;
+ # The user is probably not logged in.
+ # So we have to pass this information to the template.
+ $vars->{'timezone'} = $user->timezone;
$vars->{'eventdata'} = $eventdata;
$vars->{'cancelaction'} = $cancelaction;