6.0.0-beta1
7/7/25

[#4609] Wrong timezone used in linked attachment notifications
Summary Wrong timezone used in linked attachment notifications
Queue IMP
Queue Version 4.1.3
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org, slusarz (at) horde (dot) org
Requester jkau (at) jasper (dot) k12 (dot) ga (dot) us
Created 11/01/2006 (6823 days ago)
Due
Updated 11/13/2007 (6446 days ago)
Assigned 11/16/2006 (6808 days ago)
Resolved 11/13/2007 (6446 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/13/2007 01:55:31 AM Michael Slusarz Comment #8
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
Fixed in 4.2.0 - looks like we were missing a call to NLS::setTimeZone().
10/26/2007 10:50:06 AM Jan Schneider Comment #7
Priority ⇒ 2. Medium
Reply to this comment
No progress.
10/26/2007 03:39:32 AM Chuck Hagenbuch Comment #6 Reply to this comment
I "fixed" this locally already but with some weird results that I 
still need to look into.
What's the status of this?
11/16/2006 12:46:39 PM Jan Schneider Comment #5
State ⇒ Assigned
Assigned to Jan Schneider
Reply to this comment
So is there a reason not to just use time instead of gmmktime in
Compose.php?
There is no difference because it returns the timestamp, so that 
doesn't fix the problem. I "fixed" this locally already but with some 
weird results that I still need to look into.
11/16/2006 05:20:55 AM Chuck Hagenbuch Comment #4
State ⇒ Feedback
Reply to this comment
So is there a reason not to just use time instead of gmmktime in 
Compose.php? And can you please upload your patch as an attachment, 
generated as a unified diff? Thanks.
11/06/2006 04:30:16 AM jkau (at) jasper (dot) k12 (dot) ga (dot) us Comment #3 Reply to this comment
I meant to say:



"On my system, gmmktime() returns seconds since epoch - 5 hours"
11/01/2006 11:20:38 PM Chuck Hagenbuch Comment #2
Summary ⇒ Wrong timezone used in linked attachment notifications
Reply to this comment
Please, PLEASE provide meaningful ticket summaries.
11/01/2006 10:52:13 PM jkau (at) jasper (dot) k12 (dot) ga (dot) us Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Queue ⇒ IMP
Summary ⇒ Down
Type ⇒ Bug
Reply to this comment
In link attachment downloaded notifications emails, the "Attachment 
Date:" is set to GMT-10 instead of GMT-5 on our system in the EST 
timezone.  Using a real example, when the receipient of the link 
attachment downloaded the attachment, the sender received the link 
attachment download notification email with:



Attachment date: Wed,  1 Nov 2006 03:37:12 -0500



when the correct time the attachment was uploaded was actually:



Wed,  1 Nov 2006 08:37:12 -0500.



The problem appears to be caused by the use of gmmktime in 
horde/imp/lib/Compose.php.  It uses:



$ts = gmmktime();

$fullpath = sprintf('%s/%s/%d', IMP_VFS_LINK_ATTACH_PATH, $auth, $ts);



So this generates a URL in  email sent to the receipient like so:



https://server/attachment.php?u=<email>&t=<gmmktime()>&f=<attachment>



horde/imp/attachment.php then uses the value of t=<gmmktime()> as the date:



time_stamp = Util::getFormData('t');

[snip]

$msg->setContents(String::wrap(sprintf(_("Your linked attachment has 
been downloaded by at least one user.\n\nAttachment name: %s\nAtt

achment date: %s\n\nClick on the following link to permanently delete 
the attachment:\n%s"), $file_name, date('r', $time_stamp), 
Util::addParamete

r(Horde::selfUrl(true, false, true), 'd', $id))));



On my system, gmmktime() returns seconds since epoch + 5 hours and 
time() returns second since epoch.  So I used this patch:



[root@puma imp]# diff attachment.php attachment.php.orig

47,49d46

< // generate timestamp that shows correct timezone for notification email

< $time_stamp_display = $time_stamp - intval(date('Z', $time_stamp));

<

113c110

<             $msg->setContents(String::wrap(sprintf(_("Your linked 
attachment has been downloaded by at least one user.\n\nAttachment 
name: %s\nAttachment date: %s\n\nClick on the following link to 
permanently delete the attachment:\n%s"), $file_name, date('r', 
$time_stamp_display), Util::addParameter(Horde::selfUrl(true, false, 
true), 'd', $id))));

---
             $msg->setContents(String::wrap(sprintf(_("Your linked 
attachment has been downloaded by at least one user.\n\nAttachment 
name: %s\nAttachment date: %s\n\nClick on the following link to 
permanently delete the attachment:\n%s"), $file_name, date('r', 
$time_stamp), Util::addParameter(Horde::selfUrl(true, false, true), 
'd', $id))));
I'm using Horde 3.1.4, IMP 4.1.3 on RHEL 4 AS U4.  This has PHP version 4.3.9.


Saved Queries